[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.
This commit is contained in:
autoantwort
2023-07-20 09:30:56 +02:00
committed by GitHub
parent 86e91e6724
commit ef155438bd
2 changed files with 3 additions and 5 deletions

View File

@@ -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()

View File

@@ -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 $<IF:$<TARGET_EXISTS:libuv::uv_a>,libuv::uv_a,libuv::uv>)
endif()
if (MSVC)