1
Description: disable release-mode in cmake.
2
Pass also -ftrack-macro-expansion=0 option to
3
reduce RAM-consumption.
4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56746
5
https://lists.debian.org/debian-devel/2013/10/msg00219.html
6
Author: Anton Gladky <gladk@debian.org>
7
Origin: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=701231#12
8
Bug-Debian: http://bugs.debian.org/726009
9
Last-Update: 2013-10-30
14
INCLUDE(FindPythonModule)
15
INCLUDE(GNUInstallDirs)
16
#===========================================================
17
+# HACK!!! If the version of gcc is 4.8 or greater, we add -ftrack-macro-expansion=0
18
+# to compiler to reduce the memory consumption during compilation step.
19
+# See http://bugs.debian.org/726009 for more information
20
+# Can be removed later, if gcc fixes its regression
21
+# Taken from http://stackoverflow.com/questions/4058565/check-gcc-minor-in-cmake
23
+EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
24
+IF (GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
25
+ MESSAGE(STATUS "GCC Version >= 4.8. Adding -ftrack-macro-expansion=0")
26
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftrack-macro-expansion=0 ")
29
+#===========================================================
31
#If flags are set, add only neccessary flags
34
SET(CMAKE_BUILD_TYPE Debug)
35
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DYADE_PTR_CAST=static_pointer_cast -DYADE_CAST=static_cast -DYADE_DEBUG")
37
- SET(CMAKE_BUILD_TYPE Release)
38
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DYADE_PTR_CAST=static_pointer_cast -DYADE_CAST=static_cast -fPIC")
40
ELSE (CMAKE_CXX_FLAGS)