Files
scylladb/cmake/mode.Sanitize.cmake
Kefu Chai 79943e0516 build: cmake: define scylla_build_mode
scylla uses build modes like "debug" and "release" to differentiate
different build modes. while we intend to use the typical build
configurations / build types used by CMake like "Debug" and
"RelWithDebInfo" for naming CMAKE_CONFIGURATION_TYPES and
CMAKE_BUILD_TYPE. the former is used for naming the build directory and
for the preprocess macro named "SCYLLA_BUILD_MODE".

`test.py` and scylladb's CI are designed based on the naming of build
directory. in which, `test.py` lists the build modes using the dedicated
build target named "list_modes", which is added by `configure.py`.

so, in this change, to prepare for adding the target,
"scylla_build_mode" is defined, so we can reuse it in a following-up
change.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2023-12-24 12:28:23 +08:00

23 lines
505 B
CMake

set(CMAKE_CXX_FLAGS_SANITIZE
""
CACHE
INTERNAL
"")
update_cxx_flags(CMAKE_CXX_FLAGS_SANITIZE
WITH_DEBUG_INFO
OPTIMIZATION_LEVEL "s")
set(scylla_build_mode "sanitize")
set(Seastar_DEFINITIONS_SANITIZE
SCYLLA_BUILD_MODE=${scylla_build_mode}
DEBUG
SANITIZE
DEBUG_LSA_SANITIZER
SCYLLA_ENABLE_ERROR_INJECTION)
foreach(definition ${Seastar_DEFINITIONS_SANITIZE})
add_compile_definitions(
$<$<CONFIG:Sanitize>:${definition}>)
endforeach()
maybe_limit_stack_usage_in_KB(50 Sanitize)