From a5c5c19bcf061cd39c2e8670cc76099f584371c9 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 19 Oct 2024 12:01:50 +0300 Subject: [PATCH] [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=" --- dll/3rdparty/libpng/CMakeLists.txt | 2 +- dll/3rdparty/libtiff/CMakeLists.txt | 2 +- dll/opengl/glu32/CMakeLists.txt | 2 +- overrides-gcc.cmake | 4 ++-- sdk/cmake/gcc.cmake | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dll/3rdparty/libpng/CMakeLists.txt b/dll/3rdparty/libpng/CMakeLists.txt index 2e293d369c5..e7599539562 100644 --- a/dll/3rdparty/libpng/CMakeLists.txt +++ b/dll/3rdparty/libpng/CMakeLists.txt @@ -1,7 +1,7 @@ add_definitions( -DWIN32 - -DNDEBUG + -DNDEBUG= -D_WINDOWS -DPNG_BUILD_DLL) diff --git a/dll/3rdparty/libtiff/CMakeLists.txt b/dll/3rdparty/libtiff/CMakeLists.txt index f7c0b904c23..2aff720a340 100644 --- a/dll/3rdparty/libtiff/CMakeLists.txt +++ b/dll/3rdparty/libtiff/CMakeLists.txt @@ -1,7 +1,7 @@ add_definitions( -DWIN32 - -DNDEBUG + -DNDEBUG= -DUSE_WIN32_FILEIO -DTIF_PLATFORM_CONSOLE) diff --git a/dll/opengl/glu32/CMakeLists.txt b/dll/opengl/glu32/CMakeLists.txt index f60619510b6..82e36ce5508 100644 --- a/dll/opengl/glu32/CMakeLists.txt +++ b/dll/opengl/glu32/CMakeLists.txt @@ -8,7 +8,7 @@ include_directories(BEFORE add_definitions( -DBUILD_GLU32 - -DNDEBUG + -DNDEBUG= -DLIBRARYBUILD -DRESOLVE_3D_TEXTURE_SUPPORT) diff --git a/overrides-gcc.cmake b/overrides-gcc.cmake index 854caf26aa9..6760d7b2039 100644 --- a/overrides-gcc.cmake +++ b/overrides-gcc.cmake @@ -1,8 +1,8 @@ foreach(lang C CXX ASM) 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_RELWITHDEBINFO "-O2 -g -DNDEBUG") + set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG=") set(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "") set(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "") endforeach() diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index 1cac600cf6f..dd8753ba060 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -141,7 +141,7 @@ endif() # Optimizations # FIXME: Revisit this to see if we even need these levels if(CMAKE_BUILD_TYPE STREQUAL "Release") - add_compile_options(-O2 -DNDEBUG) + add_compile_options(-O2 -DNDEBUG=) else() if(OPTIMIZE STREQUAL "1") add_compile_options(-Os)