Files
scylladb/cmake/mode.Debug.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

25 lines
630 B
CMake

if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
# -fasan -Og breaks some coroutines on aarch64, use -O0 instead
set(OptimizationLevel "0")
else()
set(OptimizationLevel "g")
endif()
update_cxx_flags(CMAKE_CXX_FLAGS_DEBUG
WITH_DEBUG_INFO
OPTIMIZATION_LEVEL ${OptimizationLevel})
set(scylla_build_mode "debug")
set(Seastar_DEFINITIONS_DEBUG
SCYLLA_BUILD_MODE=${scylla_build_mode}
DEBUG
SANITIZE
DEBUG_LSA_SANITIZER
SCYLLA_ENABLE_ERROR_INJECTION)
foreach(definition ${Seastar_DEFINITIONS_DEBUG})
add_compile_definitions(
$<$<CONFIG:Debug>:${definition}>)
endforeach()
maybe_limit_stack_usage_in_KB(40 Debug)