Changeset View
Changeset View
Standalone View
Standalone View
src/CMakeLists.txt
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | native_add_cmake_flags( | ||||
# Forward the current setting for clang-tidy | # Forward the current setting for clang-tidy | ||||
"-DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY}" | "-DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY}" | ||||
) | ) | ||||
if(ENABLE_CLANG_TIDY) | if(ENABLE_CLANG_TIDY) | ||||
include(ClangTidy) | include(ClangTidy) | ||||
endif() | endif() | ||||
# Allow usage of sanitizers by setting ECM_ENABLE_SANITIZERS | |||||
if(ENABLE_SANITIZERS) | if(ENABLE_SANITIZERS) | ||||
set(ECM_ENABLE_SANITIZERS ${ENABLE_SANITIZERS}) | include(Sanitizers) | ||||
find_package(ECM NO_MODULE) | enable_sanitizers(${ENABLE_SANITIZERS}) | ||||
if(ECM_MODULE_PATH) | |||||
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) | |||||
include(ECMEnableSanitizers) | |||||
else() | |||||
message(FATAL_ERROR | |||||
"ECM is required to enable the sanitizers (https://api.kde.org/ecm/manual/ecm.7.html). Try installing 'extra-cmake-modules' package." | |||||
) | |||||
endif() | |||||
endif() | endif() | ||||
include(AddCompilerFlags) | include(AddCompilerFlags) | ||||
# Prefer -g3, defaults to -g if unavailable | # Prefer -g3, defaults to -g if unavailable | ||||
foreach(LANGUAGE C CXX) | foreach(LANGUAGE C CXX) | ||||
set(COMPILER_DEBUG_LEVEL -g) | set(COMPILER_DEBUG_LEVEL -g) | ||||
check_compiler_flag(G3_IS_SUPPORTED ${LANGUAGE} -g3) | check_compiler_flag(G3_IS_SUPPORTED ${LANGUAGE} -g3) | ||||
▲ Show 20 Lines • Show All 517 Lines • Show Last 20 Lines |