in this change,
* all `Seastar_OptimizationLevel_*` are dropped.
* mode.Sanitize.cmake:
s/CMAKE_CXX_FLAGS_COVERAGE/CMAKE_CXX_FLAGS_SANITIZE/
* mode.Dev.cmake:
s/CMAKE_CXX_FLAGS_RELEASE/CMAKE_CXX_FLAGS_DEV/
Seastar_OptimizationLevel_* variables have nothing to do with
Seastar, and they introduce unnecessary indirection. the function
of `update_cxx_flags()` already requires an option name for this
parameter, so there is no need to have a name for it.
the cached entry of `Seastar_OptimizationLevel_DEBUG` is also
dropped, if we really need to have knobs which can be configured
by user, we should define them in a more formal way. at this
moment, this is not necessary. so drop it along with this
variable.
Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
Closes scylladb/scylladb#16059
25 lines
591 B
CMake
25 lines
591 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(Seastar_DEFINITIONS_COVERAGE
|
|
SCYLLA_BUILD_MODE=coverage
|
|
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)
|