From 9df0ee099b136a5f68904d3d55fb464fb61482fe Mon Sep 17 00:00:00 2001 From: Klemens Morgenstern Date: Thu, 9 Oct 2025 21:25:32 +0800 Subject: [PATCH] target_link_Libraries signature fix --- test/v2/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/v2/CMakeLists.txt b/test/v2/CMakeLists.txt index 986c8bb1..001e77e6 100644 --- a/test/v2/CMakeLists.txt +++ b/test/v2/CMakeLists.txt @@ -2,7 +2,7 @@ enable_testing() function(boost_process_v2_standalone_test name) add_executable(boost_process_v2_${name} ${name}.cpp test_impl.cpp) - target_link_libraries(boost_process_v2_${name} Boost::process Boost::system Boost::filesystem Boost::unit_test_framework ) + target_link_libraries(boost_process_v2_${name} PUBLIC Boost::process Boost::system Boost::filesystem Boost::unit_test_framework ) if (WIN32) target_compile_definitions(boost_process_v2_${name} PUBLIC WIN32_LEAN_AND_MEAN=1) target_link_libraries(boost_process_v2_${name} PUBLIC Ntdll) @@ -21,12 +21,15 @@ target_link_libraries(boost_process_v2_test_target PUBLIC Boost::process Boost:: function(boost_process_v2_test_with_target name) add_executable(boost_process_v2_${name} ${name}.cpp) - target_link_libraries(boost_process_v2_${name} Boost::process Boost::system Boost::filesystem boost_process_v2_test_impl) + target_link_libraries(boost_process_v2_${name} PUBLIC Boost::process Boost::system Boost::filesystem boost_process_v2_test_impl) + if (WIN32) + target_compile_definitions(boost_process_v2_${name} PUBLIC WIN32_LEAN_AND_MEAN=1) + target_link_libraries(boost_process_v2_${name} PUBLIC Ntdll) + endif() add_dependencies(boost_process_v2_${name} boost_process_v2_test_target) add_test(NAME boost_process_v2_${name} COMMAND $ -- $) - endfunction() boost_process_v2_test_with_target(process)