From 00c0334ec4240840195a61c66901d0952f57c1d4 Mon Sep 17 00:00:00 2001 From: Gregor Jasny Date: Thu, 8 Dec 2022 18:40:55 +0100 Subject: [PATCH] test(push): gethostname requires Winsock library --- cmake/project-import-cmake/CMakeLists.txt | 2 +- cmake/project-import-pkgconfig/CMakeLists.txt | 2 +- push/tests/integration/CMakeLists.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/project-import-cmake/CMakeLists.txt b/cmake/project-import-cmake/CMakeLists.txt index adf04039..89d4788e 100644 --- a/cmake/project-import-cmake/CMakeLists.txt +++ b/cmake/project-import-cmake/CMakeLists.txt @@ -6,7 +6,7 @@ find_package(prometheus-cpp CONFIG REQUIRED) if(PROMETHEUS_CPP_ENABLE_PUSH) add_executable(sample-client sample_client.cc) - target_link_libraries(sample-client PRIVATE prometheus-cpp::push) + target_link_libraries(sample-client PRIVATE prometheus-cpp::push $<$:Ws2_32>) endif() if(PROMETHEUS_CPP_ENABLE_PULL) diff --git a/cmake/project-import-pkgconfig/CMakeLists.txt b/cmake/project-import-pkgconfig/CMakeLists.txt index bcd1d8e1..5a6ef9ff 100644 --- a/cmake/project-import-pkgconfig/CMakeLists.txt +++ b/cmake/project-import-pkgconfig/CMakeLists.txt @@ -12,7 +12,7 @@ pkg_check_modules(PROMETHEUS_CPP_PULL IMPORTED_TARGET prometheus-cpp-pull) if(PROMETHEUS_CPP_PUSH_FOUND) add_executable(sample-client sample_client.cc) - target_link_libraries(sample-client PRIVATE PkgConfig::PROMETHEUS_CPP_PUSH) + target_link_libraries(sample-client PRIVATE PkgConfig::PROMETHEUS_CPP_PUSH $<$:Ws2_32>) endif() if(PROMETHEUS_CPP_PULL_FOUND) diff --git a/push/tests/integration/CMakeLists.txt b/push/tests/integration/CMakeLists.txt index 3af6856e..a2e7a3f7 100644 --- a/push/tests/integration/CMakeLists.txt +++ b/push/tests/integration/CMakeLists.txt @@ -6,4 +6,5 @@ add_executable(sample_client target_link_libraries(sample_client PRIVATE ${PROJECT_NAME}::push + $<$:Ws2_32> )