gnucash master: Revert "Set C and C++ standards the modern Cmake way, and set C++ to C++17."

John Ralls jralls at code.gnucash.org
Wed Oct 9 00:07:15 EDT 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/58cfb58b (commit)
	from  https://github.com/Gnucash/gnucash/commit/b5afd2e3 (commit)



commit 58cfb58b9cfe5d1fdbaec0c266d9247f9eb5134d
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Oct 8 21:05:00 2019 -0700

    Revert "Set C and C++ standards the modern Cmake way, and set C++ to C++17."
    
    This reverts commit b5afd2e319b0f06697c83806e85dd15fab508e5b.
    
    Our baseline distro, Ubuntu 18.04, provides boost 1.65 and boost 1.67
    is required for building with C++17 because the boost::locale developer
    hung on to auto_ptr 6 years longer than he should have.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 42665f77c..283c48521 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -512,7 +512,7 @@ set (Boost_FIND_QUIETLY ON)
 if (NOT DEFINED ${BOOST_ROOT})
   set(BOOST_ROOT $ENV{BOOST_ROOT})
 endif()
-find_package (Boost 1.67.0 REQUIRED COMPONENTS date_time regex locale filesystem system)
+find_package (Boost 1.54.0 REQUIRED COMPONENTS date_time regex locale filesystem system)
 
 if (Boost_FOUND)
   include_directories(${Boost_INCLUDE_DIRS})
@@ -534,22 +534,18 @@ endif()
 add_definitions(-D_GNU_SOURCE)
 
 # Also, set the C++ version to c++11
-set(CMAKE_CXX_STANDARD 17)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_EXTENSIONS OFF)
-set(CMAKE_C_STANDARD 11)
-set(CMAKE_C_STANDARD_REQUIRED ON)
-set(CMAKE_C_EXTENSIONS ON)
+set(CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}")  # FIXME: should be -std=c++11
+
 
 if (UNIX)
   set( CMAKE_C_FLAGS "-Werror -Wdeclaration-after-statement -Wno-pointer-sign -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-unused ${CMAKE_C_FLAGS}")
-  set( CMAKE_C_FLAGS "-Wno-error=deprecated-declarations -Wno-error=parentheses ${CMAKE_C_FLAGS}")
+  set( CMAKE_C_FLAGS "-Wno-error=deprecated-declarations -std=gnu11 -Wno-error=parentheses ${CMAKE_C_FLAGS}")
   set( CMAKE_CXX_FLAGS "-Werror -Wall -Wmissing-declarations -Wno-unused -Wno-error=parentheses ${CMAKE_CXX_FLAGS}")
   set( CMAKE_CXX_FLAGS "-Wno-error=deprecated-declarations ${REGISTER_CXXFLAG} ${CMAKE_CXX_FLAGS}")
   set( CMAKE_C_FLAGS_RELEASE "-O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${CMAKE_C_FLAGS}")
 endif (UNIX)
 if (MINGW)
-  set( CMAKE_C_FLAGS "-Werror -Wdeclaration-after-statement -Wno-pointer-sign -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations  -Wno-unused -Wno-error=deprecated-declarations ${CMAKE_C_FLAGS}")
+  set( CMAKE_C_FLAGS "-Werror -Wdeclaration-after-statement -Wno-pointer-sign -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations  -Wno-unused -Wno-error=deprecated-declarations -std=gnu11 ${CMAKE_C_FLAGS}")
   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)
 
diff --git a/README.dependencies b/README.dependencies
index bc0351e37..94ceb234a 100644
--- a/README.dependencies
+++ b/README.dependencies
@@ -62,8 +62,6 @@ Libraries/Deps
 --------------
   required		Version
   --------		_______
-  gcc or clang          8.0 (gcc)/6.0 (clang)   C/C++ compiler
-  cmake                 3.10                    Build system.
   glib2			2.40.0
   gtk+3			3.14.0
   guile			2.2.0 or 2.0.0
@@ -72,12 +70,12 @@ Libraries/Deps
   libxslt, including xsltproc
   ICU                                           International Components for
                                                 Unicode
-  boost			1.67.0                  locale and regex libs must be
+  boost			1.50.0                  locale and regex libs must be
                                                 built with ICU support.
-  swig			3.0.12			Makes Guile and Python Bindings.
+  swig			2.0.10			Only required to build from git.
   webkit		webkitgtk-3.0 (Windows, Mac)
                         webkit2gtk-3.0 (Everything Else)
-  googletest            1.8.0                   Some distros call it gtest.
+  googletest            1.7.0                   Some distros call it gtest.
                                                 Some distros also separate out
                                                 googlemock or gmock; both are
                                                 required.



Summary of changes:
 CMakeLists.txt      | 14 +++++---------
 README.dependencies |  8 +++-----
 2 files changed, 8 insertions(+), 14 deletions(-)



More information about the gnucash-changes mailing list