From 3870a479e59815ab98c9127c96bbe515fc9111b4 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 19 Oct 2024 16:47:37 +0800 Subject: [PATCH] build: expose -DBOOST_TEST_DYN_LINK instead of -DBoost_TEST_DYN_LINK before this change, we include `-DBoost_TEST_DYN_LINK` in seastar_testing_cflags. but this macro is not documented by Boost document, what we should use is `BOOST_TEST_DYN_LINK`, see https://www.boost.org/doc/libs/1_86_0/libs/test/doc/html/boost_test/utf_reference/link_references/link_boost_test_dyn_link.html the reason why the tests build, is that they - either link against `Boost::dynamic_linking` via Seastar's CMake building system - or pass `-DBOOST_ALL_DYN_LINK` by themselves but this not the intended usage. the tests should link against `seastar_testing` without worrying about this linkage or the definition. in this change, we correct the macro to the one documented. also, to be consistent with the CMake building system, where we link against `Boost::dynamic_linking`, we use a generator expression to extract the compile definitions from this library target instead of using the `BOOST_ALL_DYN_LINK` directly. Signed-off-by: Kefu Chai --- pkgconfig/seastar-testing.pc.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgconfig/seastar-testing.pc.in b/pkgconfig/seastar-testing.pc.in index f7d2d7390e6..7859c24dacd 100644 --- a/pkgconfig/seastar-testing.pc.in +++ b/pkgconfig/seastar-testing.pc.in @@ -8,11 +8,11 @@ Description: Testing tools for libraries and applications built with Seastar Version: @PROJECT_VERSION@ # Dependencies. -boost_cflags=-I$ +boost_cflags=-I$ -D$, -D> boost_unit_test_libs=@Boost_UNIT_TEST_FRAMEWORK_LIBRARY@ # Us. -seastar_testing_cflags=-DBoost_TEST_DYN_LINK +seastar_testing_cflags= seastar_testing_libs=${libdir}/$ Requires: seastar >= 1.0