Skip to content

Commit

Permalink
build: expose -DBOOST_TEST_DYN_LINK instead of -DBoost_TEST_DYN_LINK
Browse files Browse the repository at this point in the history
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 <kefu.chai@scylladb.com>
  • Loading branch information
tchaikov committed Oct 19, 2024
1 parent 788c8d1 commit 3870a47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkgconfig/seastar-testing.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Description: Testing tools for libraries and applications built with Seastar
Version: @PROJECT_VERSION@

# Dependencies.
boost_cflags=-I$<JOIN:@Boost_INCLUDE_DIRS@, -I>
boost_cflags=-I$<JOIN:@Boost_INCLUDE_DIRS@, -I> -D$<JOIN:$<TARGET_PROPERTY:Boost::dynamic_linking,INTERFACE_COMPILE_DEFINITIONS>, -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}/$<TARGET_FILE_NAME:seastar_testing>

Requires: seastar >= 1.0
Expand Down

0 comments on commit 3870a47

Please sign in to comment.