Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: support enabled options when building seastar-module #2252

Merged
merged 3 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -877,13 +877,6 @@ endif ()
set( MEMORYCHECK_COMMAND_OPTIONS "--error-exitcode=1 --leak-check=no --trace-children=yes" )
include (CTest)

if (Seastar_MODULE)
if (POLICY CMP0155)
cmake_policy (SET CMP0155 NEW)
endif ()
include (CxxModulesRules)
add_subdirectory (src)
endif ()
#
# We want asserts enabled on all modes, but cmake defaults to passing
# -DNDEBUG in some modes. We add -UNDEBUG to our private options to
Expand Down Expand Up @@ -1184,6 +1177,14 @@ if (Seastar_INSTALL OR Seastar_TESTING)

endif ()

if (Seastar_MODULE)
if (POLICY CMP0155)
cmake_policy (SET CMP0155 NEW)
endif ()
include (CxxModulesRules)
add_subdirectory (src)
endif ()

#
# The tests themselves.
#
Expand Down
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
1 change: 1 addition & 0 deletions src/core/reactor_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module;
#include <sys/syscall.h>
#include <sys/resource.h>
#include <boost/container/small_vector.hpp>
#include <fmt/core.h>

#ifdef SEASTAR_HAVE_URING
#include <liburing.h>
Expand Down
8 changes: 4 additions & 4 deletions src/core/resource.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ module;
#include <limits>
#include <filesystem>
#include <unordered_map>
#include <fmt/core.h>
#if SEASTAR_HAVE_HWLOC
#include <hwloc/glibc-sched.h>
#endif

#ifdef SEASTAR_MODULE
module seastar;
Expand All @@ -49,10 +53,6 @@ module seastar;
#include <seastar/core/print.hh>
#include "cgroup.hh"

#if SEASTAR_HAVE_HWLOC
#include <hwloc/glibc-sched.h>
#endif

#endif

namespace seastar {
Expand Down
4 changes: 3 additions & 1 deletion src/seastar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ module;
#include <fmt/ostream.h>
#include <fmt/printf.h>
#include <gnutls/crypto.h>

#ifdef SEASTAR_HAVE_HWLOC
#include <hwloc.h>
#endif
#if defined(__x86_64__) || defined(__i386__)
#include <xmmintrin.h>
#endif
Expand Down
Loading