gnucash unstable: ADD_DEFINITIONS is obsolete for setting C/CXXFLAGS.

John Ralls jralls at code.gnucash.org
Tue Feb 13 19:50:16 EST 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/ae6d2a23 (commit)
	from  https://github.com/Gnucash/gnucash/commit/da0df1c4 (commit)



commit ae6d2a2340af74588cda6dcc550b75c2c7967bc9
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Feb 13 16:47:20 2018 -0800

    ADD_DEFINITIONS is obsolete for setting C/CXXFLAGS.
    
    And setting -O0 in a debug build is unnecessary, that's the default.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index da1858d..26f470c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -516,9 +516,11 @@ if (APPLE)
   endif()
   Check_C_Compiler_Flag(-Wno-unknown-attributes have_no_unkatt)
   if (have_no_unkatt)
-    ADD_DEFINITIONS(-Wno-unknown-attributes -Wno-typedef-redefinition)
+    set(CMAKE_C_FLAGS "-Wno-unknown-attributes -Wno-typedef-redefinition ${CMAKE_C_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-Wno-unknown-attributes -Wno-typedef-redefinition ${CMAKE_CXX_FLAGS}")
   else()
-    ADD_DEFINITIONS(-Wno-typedef-redefinition)
+    set(CMAKE_C_FLAGS "-Wno-typedef-redefinition ${CMAKE_C_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-Wno-typedef-redefinition ${CMAKE_CXX_FLAGS}")
   endif()
   #  SET (CMAKE_OSX_ARCHITECTURES "i386")
 endif (APPLE)
@@ -539,9 +541,6 @@ IF (MINGW)
   SET( CMAKE_CXX_FLAGS "-DWINVER=0x0500 -D_EMULATE_GLIBC=0 ${CMAKE_CXX_FLAGS}") # Workaround for bug in gtest on mingw, see https://github.com/google/googletest/issues/893 and https://github.com/google/googletest/issues/920
 ENDIF (MINGW)
 
-SET( CMAKE_C_FLAGS_DEBUG "-O0 -g ${CMAKE_C_FLAGS}")
-SET( CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wno-deprecated-declarations ${CMAKE_CXX_FLAGS}")
-
 IF (APPLE AND WITH_GNUCASH)
   SET(CMAKE_MACOSX_RPATH ON)
   SET(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}")



Summary of changes:
 CMakeLists.txt | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)



More information about the gnucash-changes mailing list