From ef155438bda7066d3f2835d577335b7321ef201c Mon Sep 17 00:00:00 2001 From: autoantwort <41973254+autoantwort@users.noreply.github.com> Date: Thu, 20 Jul 2023 09:30:56 +0200 Subject: [PATCH] [build] Consume libuv via cmake config instead of via pkg-config (#5438) The problem is that you have to use a different pkg-config file if you want to use a static variant of libuv, but the buildsystem should not care which variant of libuv should be used. This is not a problem with the cmake config. --- CMakeLists.txt | 3 +-- wpinet/CMakeLists.txt | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4291632af5..601f81941f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -167,8 +167,7 @@ endif() if (USE_SYSTEM_LIBUV) set (LIBUV_SYSTEM_REPLACE " -find_package(PkgConfig REQUIRED) -pkg_check_modules(libuv REQUIRED IMPORTED_TARGET libuv) +find_dependency(libuv CONFIG) ") endif() diff --git a/wpinet/CMakeLists.txt b/wpinet/CMakeLists.txt index 2e7cda574d..a11ca98481 100644 --- a/wpinet/CMakeLists.txt +++ b/wpinet/CMakeLists.txt @@ -146,9 +146,8 @@ if (NOT USE_SYSTEM_LIBUV) endif() endif() else() - find_package(PkgConfig REQUIRED) - pkg_check_modules(libuv REQUIRED IMPORTED_TARGET libuv) - target_link_libraries(wpinet PUBLIC PkgConfig::libuv) + find_package(libuv CONFIG REQUIRED) + target_link_libraries(wpinet PUBLIC $,libuv::uv_a,libuv::uv>) endif() if (MSVC)