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>
26 lines
637 B
CMake
26 lines
637 B
CMake
set(CMAKE_CXX_FLAGS_COVERAGE
|
|
"-fprofile-instr-generate -fcoverage-mapping"
|
|
CACHE
|
|
INTERNAL
|
|
"")
|
|
update_cxx_flags(CMAKE_CXX_FLAGS_COVERAGE
|
|
WITH_DEBUG_INFO
|
|
OPTIMIZATION_LEVEL "g")
|
|
|
|
set(scylla_build_mode "coverage")
|
|
set(Seastar_DEFINITIONS_COVERAGE
|
|
SCYLLA_BUILD_MODE=${scylla_build_mode}
|
|
DEBUG
|
|
SANITIZE
|
|
DEBUG_LSA_SANITIZER
|
|
SCYLLA_ENABLE_ERROR_INJECTION)
|
|
foreach(definition ${Seastar_DEFINITIONS_COVERAGE})
|
|
add_compile_definitions(
|
|
$<$<CONFIG:Coverage>:${definition}>)
|
|
endforeach()
|
|
|
|
set(CMAKE_STATIC_LINKER_FLAGS_COVERAGE
|
|
"-fprofile-instr-generate -fcoverage-mapping")
|
|
|
|
maybe_limit_stack_usage_in_KB(40 Coverage)
|