Skip to content

Commit

Permalink
build: support enabled options when building seastar-module
Browse files Browse the repository at this point in the history
before this change, when building seastar-module, we don't check for
the enabled features. so, for instance io uring backend is not enabled
even `Seastar_IO_URING` is set.

in this change we

* check for the enabled options,
* link against the related libraries, and
* add the required macro definitions

this should enable seastar-module to build with, for instance, io_uring
backend enabled. as `SEASTAR_HAVE_URING` enables this backend when
building `src/core/reactor_backend.cc`.

Fixes #2249
Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed May 19, 2024
1 parent bc2f324 commit 8005611
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ target_compile_definitions (seastar-module
SEASTAR_SCHEDULING_GROUPS_COUNT=${Seastar_SCHEDULING_GROUPS_COUNT}
SEASTAR_COROUTINES_ENABLED
PRIVATE
SEASTAR_MODULE)
SEASTAR_MODULE
${Seastar_PRIVATE_COMPILE_DEFINITIONS})
target_compile_options (seastar-module
PUBLIC
-U_FORTIFY_SOURCE)
Expand Down Expand Up @@ -126,6 +127,18 @@ target_link_libraries (seastar-module
yaml-cpp::yaml-cpp
"$<BUILD_INTERFACE:Valgrind::valgrind>"
Threads::Threads)
if (Seastar_NUMA)
target_link_libraries (seastar-module
PRIVATE numactl::numactl)
endif ()
if (Seastar_HWLOC)
target_link_libraries (seastar-module
PRIVATE hwloc::hwloc)
endif ()
if (Seastar_IO_URING)
target_link_libraries (seastar-module
PRIVATE URING::uring)
endif ()

install (
TARGETS seastar-module
Expand Down

0 comments on commit 8005611

Please sign in to comment.