You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
595 B
22 lines
595 B
|
|
include(CompileCheck) |
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "") |
|
set(CMAKE_BUILD_TYPE "Release") |
|
endif() |
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug") |
|
|
|
add_definitions(-DDEBUG) |
|
|
|
check_compiler_flag(RESULT "-g3") |
|
if(NOT RESULT STREQUAL "") |
|
string(REGEX REPLACE "-g(|[0-9]|gdb)" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") |
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${RESULT}") |
|
endif() |
|
|
|
check_compiler_flag(RESULT "-O0") |
|
string(REGEX REPLACE "-O[0-9]" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") |
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${RESULT}") |
|
|
|
endif()
|
|
|