From 4447c9a46edafc5dbea80c96add3605c177c1b5b Mon Sep 17 00:00:00 2001 From: Andrea Pappacoda Date: Wed, 14 Dec 2022 09:30:31 +0100 Subject: [PATCH] build: tweak the find modules even more As described in https://github.com/yuzu-emu/yuzu/pull/9395#discussion_r1047456172 checking for PKG_CONFIG_FOUND before calling pkg_search_module() is unneeded, and some find modules (like FindFFmpeg.cmake) don't do this already. Consequently, this patch removes these checks. --- externals/find-modules/FindOpus.cmake | 4 +--- externals/find-modules/Findenet.cmake | 4 +--- externals/find-modules/Findhttplib.cmake | 4 +--- externals/find-modules/Findinih.cmake | 4 +--- externals/find-modules/Findlibusb.cmake | 4 +--- externals/find-modules/Findlz4.cmake | 4 +--- externals/find-modules/Findzstd.cmake | 4 +--- 7 files changed, 7 insertions(+), 21 deletions(-) diff --git a/externals/find-modules/FindOpus.cmake b/externals/find-modules/FindOpus.cmake index 2ba515352..25a44fd87 100644 --- a/externals/find-modules/FindOpus.cmake +++ b/externals/find-modules/FindOpus.cmake @@ -2,9 +2,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later find_package(PkgConfig QUIET) -if (PKG_CONFIG_FOUND) - pkg_search_module(OPUS QUIET IMPORTED_TARGET opus) -endif() +pkg_search_module(OPUS QUIET IMPORTED_TARGET opus) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Opus diff --git a/externals/find-modules/Findenet.cmake b/externals/find-modules/Findenet.cmake index 6dae76f4c..859a6f386 100644 --- a/externals/find-modules/Findenet.cmake +++ b/externals/find-modules/Findenet.cmake @@ -3,9 +3,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later find_package(PkgConfig QUIET) -if (PKG_CONFIG_FOUND) - pkg_search_module(ENET QUIET IMPORTED_TARGET libenet) -endif() +pkg_search_module(ENET QUIET IMPORTED_TARGET libenet) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(enet diff --git a/externals/find-modules/Findhttplib.cmake b/externals/find-modules/Findhttplib.cmake index b72bad076..4d17cb393 100644 --- a/externals/find-modules/Findhttplib.cmake +++ b/externals/find-modules/Findhttplib.cmake @@ -9,9 +9,7 @@ if (httplib_FOUND) find_package_handle_standard_args(httplib CONFIG_MODE) else() find_package(PkgConfig QUIET) - if (PKG_CONFIG_FOUND) - pkg_search_module(HTTPLIB QUIET IMPORTED_TARGET cpp-httplib) - endif() + pkg_search_module(HTTPLIB QUIET IMPORTED_TARGET cpp-httplib) find_package_handle_standard_args(httplib REQUIRED_VARS HTTPLIB_INCLUDEDIR VERSION_VAR HTTPLIB_VERSION diff --git a/externals/find-modules/Findinih.cmake b/externals/find-modules/Findinih.cmake index 8d1a07243..b8d38dcff 100644 --- a/externals/find-modules/Findinih.cmake +++ b/externals/find-modules/Findinih.cmake @@ -3,9 +3,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later find_package(PkgConfig QUIET) -if (PKG_CONFIG_FOUND) - pkg_search_module(INIREADER QUIET IMPORTED_TARGET INIReader) -endif() +pkg_search_module(INIREADER QUIET IMPORTED_TARGET INIReader) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(inih diff --git a/externals/find-modules/Findlibusb.cmake b/externals/find-modules/Findlibusb.cmake index 66f61001c..0eadce957 100644 --- a/externals/find-modules/Findlibusb.cmake +++ b/externals/find-modules/Findlibusb.cmake @@ -3,9 +3,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later find_package(PkgConfig QUIET) -if (PKG_CONFIG_FOUND) - pkg_search_module(LIBUSB QUIET IMPORTED_TARGET libusb-1.0) -endif() +pkg_search_module(LIBUSB QUIET IMPORTED_TARGET libusb-1.0) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(libusb diff --git a/externals/find-modules/Findlz4.cmake b/externals/find-modules/Findlz4.cmake index f4c7005ba..c82405c59 100644 --- a/externals/find-modules/Findlz4.cmake +++ b/externals/find-modules/Findlz4.cmake @@ -8,9 +8,7 @@ if (lz4_FOUND) find_package_handle_standard_args(lz4 CONFIG_MODE) else() find_package(PkgConfig QUIET) - if (PKG_CONFIG_FOUND) - pkg_search_module(LZ4 QUIET IMPORTED_TARGET liblz4) - endif() + pkg_search_module(LZ4 QUIET IMPORTED_TARGET liblz4) find_package_handle_standard_args(lz4 REQUIRED_VARS LZ4_LINK_LIBRARIES VERSION_VAR LZ4_VERSION diff --git a/externals/find-modules/Findzstd.cmake b/externals/find-modules/Findzstd.cmake index 1aacc41d0..f6eb9643a 100644 --- a/externals/find-modules/Findzstd.cmake +++ b/externals/find-modules/Findzstd.cmake @@ -8,9 +8,7 @@ if (zstd_FOUND) find_package_handle_standard_args(zstd CONFIG_MODE) else() find_package(PkgConfig QUIET) - if (PKG_CONFIG_FOUND) - pkg_search_module(ZSTD QUIET IMPORTED_TARGET libzstd) - endif() + pkg_search_module(ZSTD QUIET IMPORTED_TARGET libzstd) find_package_handle_standard_args(zstd REQUIRED_VARS ZSTD_LINK_LIBRARIES VERSION_VAR ZSTD_VERSION