CMake: configurations & compilation flags
This commit is contained in:
parent
77fcc23026
commit
aa88bcf0fd
|
@ -38,19 +38,28 @@ endif()
|
|||
|
||||
### Options ###
|
||||
|
||||
# Configurations
|
||||
set(CMAKE_CONFIGURATION_TYPES
|
||||
Debug Release RelWithDebInfo MinSizeRel
|
||||
CACHE STRING "Set the configurations" FORCE)
|
||||
# Default configuration
|
||||
if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE RelWithDebInfo
|
||||
CACHE STRING "Set the default configuration" FORCE)
|
||||
endif()
|
||||
|
||||
option (DEBUG
|
||||
"Enable debug code"
|
||||
on)
|
||||
if (DEBUG)
|
||||
add_definitions(-DDEBUG)
|
||||
endif (DEBUG)
|
||||
endif()
|
||||
|
||||
option (NDEBUG
|
||||
"Enable no-debug mode (for assert() and others)"
|
||||
off)
|
||||
if (NDEBUG)
|
||||
add_definitions(-DNDEBUG)
|
||||
endif (NDEBUG)
|
||||
|
||||
### Flags ###
|
||||
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -Wstrict-prototypes")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra")
|
||||
|
||||
|
||||
### Libraries ###
|
||||
|
|
Loading…
Reference in New Issue