From 8005611475075f3e8fdad387d6228f1f3403af40 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 19 May 2024 11:58:53 +0800 Subject: [PATCH] build: support enabled options when building seastar-module 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 --- src/CMakeLists.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8848782c5ca..b99ebb19b6d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) @@ -126,6 +127,18 @@ target_link_libraries (seastar-module yaml-cpp::yaml-cpp "$" 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