summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 10 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7bed8396..8bc79b05 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -93,21 +93,28 @@ test_and_set_c_compiler_flag_global(-Wunreachable-code)
test_and_set_c_compiler_flag_global(-Wdeclaration-after-statement)
test_and_set_c_compiler_flag_global(-Winfinite-recursion)
test_and_set_c_compiler_flag_global(-fmax-errors=5)
+
if (CMAKE_BUILD_TYPE STREQUAL "Release")
test_and_set_c_compiler_flag_global(-O3)
-else ()
+elseif (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ test_and_set_c_compiler_flag_global(-g)
+elseif (CMAKE_BUILD_TYPE STREQUAL "DebugASan")
test_and_set_c_compiler_flag_global(-g)
-endif ()
-if (CMAKE_BUILD_TYPE STREQUAL "DebugASan")
test_and_set_c_compiler_flag_global(-fsanitize=address)
elseif (CMAKE_BUILD_TYPE STREQUAL "DebugTSan")
+ test_and_set_c_compiler_flag_global(-g)
test_and_set_c_compiler_flag_global(-fsanitize=thread)
elseif (CMAKE_BUILD_TYPE STREQUAL "DebugLSan")
+ test_and_set_c_compiler_flag_global(-g)
test_and_set_c_compiler_flag_global(-fsanitize=leak)
elseif (CMAKE_BUILD_TYPE STREQUAL "DebugUSan")
+ test_and_set_c_compiler_flag_global(-g)
test_and_set_c_compiler_flag_global(-fsanitize=undefined)
elseif (CMAKE_BUILD_TYPE STREQUAL "DebugAnalyzer")
+ test_and_set_c_compiler_flag_global(-g)
test_and_set_c_compiler_flag_global(-fanalyzer)
+else ()
+ message(FATAL_ERROR "Unkown build type ${CMAKE_BUILD_TYPE}")
endif ()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ouroboros-dev.pc.in"