1
0
Fork 0

CMake: Consistently set _DEBUG and NDEBUG in all platforms

This commit is contained in:
Yuri Kunde Schlesner 2015-01-10 18:42:24 -02:00
parent e213f91373
commit 57503df97f
1 changed files with 5 additions and 1 deletions

View File

@ -24,7 +24,7 @@ else()
# /GR- - Disable RTTI # /GR- - Disable RTTI
# /GS- - No stack buffer overflow checks # /GS- - No stack buffer overflow checks
# /EHsc - C++-only exception handling semantics # /EHsc - C++-only exception handling semantics
set(optimization_flags "/MP /MD /Ox /Oy- /DNDEBUG /GR- /GS- /EHsc") set(optimization_flags "/MP /MD /Ox /Oy- /GR- /GS- /EHsc")
# /Zi - Output debugging information # /Zi - Output debugging information
# /Zo - enahnced debug info for optimized builds # /Zo - enahnced debug info for optimized builds
set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /Zi" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /Zi" CACHE STRING "" FORCE)
@ -32,7 +32,11 @@ else()
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${optimization_flags} /Zi /Zo" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS_RELWITHDEBINFO "${optimization_flags} /Zi /Zo" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${optimization_flags} /Zi /Zo" CACHE STRING "" FORCE) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${optimization_flags} /Zi /Zo" CACHE STRING "" FORCE)
endif() endif()
add_definitions(-DSINGLETHREADED) add_definitions(-DSINGLETHREADED)
# CMake seems to only define _DEBUG on Windows
set_property(DIRECTORY APPEND PROPERTY
COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG> $<$<NOT:$<CONFIG:Debug>>:NDEBUG>)
find_package(PNG QUIET) find_package(PNG QUIET)
if (PNG_FOUND) if (PNG_FOUND)