[CMAKE] Fix warning about redefinition of NDEBUG on release builds

"-DNDEBUG" will result in NDEBUG being defined as 0. To define it to nothing, like we do in our code, it must be "-DNDEBUG="
This commit is contained in:
Timo Kreuzer 2024-10-19 12:01:50 +03:00
parent 88b3d86b29
commit a5c5c19bcf
5 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,7 @@
add_definitions( add_definitions(
-DWIN32 -DWIN32
-DNDEBUG -DNDEBUG=
-D_WINDOWS -D_WINDOWS
-DPNG_BUILD_DLL) -DPNG_BUILD_DLL)

View file

@ -1,7 +1,7 @@
add_definitions( add_definitions(
-DWIN32 -DWIN32
-DNDEBUG -DNDEBUG=
-DUSE_WIN32_FILEIO -DUSE_WIN32_FILEIO
-DTIF_PLATFORM_CONSOLE) -DTIF_PLATFORM_CONSOLE)

View file

@ -8,7 +8,7 @@ include_directories(BEFORE
add_definitions( add_definitions(
-DBUILD_GLU32 -DBUILD_GLU32
-DNDEBUG -DNDEBUG=
-DLIBRARYBUILD -DLIBRARYBUILD
-DRESOLVE_3D_TEXTURE_SUPPORT) -DRESOLVE_3D_TEXTURE_SUPPORT)

View file

@ -1,8 +1,8 @@
foreach(lang C CXX ASM) foreach(lang C CXX ASM)
set(CMAKE_${lang}_FLAGS_DEBUG "") set(CMAKE_${lang}_FLAGS_DEBUG "")
set(CMAKE_${lang}_FLAGS_MINSIZEREL "-Os -DNDEBUG") set(CMAKE_${lang}_FLAGS_MINSIZEREL "-Os -DNDEBUG=")
set(CMAKE_${lang}_FLAGS_RELEASE "") set(CMAKE_${lang}_FLAGS_RELEASE "")
set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG") set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG=")
set(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "") set(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "")
set(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "") set(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "")
endforeach() endforeach()

View file

@ -141,7 +141,7 @@ endif()
# Optimizations # Optimizations
# FIXME: Revisit this to see if we even need these levels # FIXME: Revisit this to see if we even need these levels
if(CMAKE_BUILD_TYPE STREQUAL "Release") if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_options(-O2 -DNDEBUG) add_compile_options(-O2 -DNDEBUG=)
else() else()
if(OPTIMIZE STREQUAL "1") if(OPTIMIZE STREQUAL "1")
add_compile_options(-Os) add_compile_options(-Os)