~ubuntu-branches/ubuntu/trusty/yade/trusty

« back to all changes in this revision

Viewing changes to debian/patches/20_disable_release-mode.patch

  • Committer: Package Import Robot
  • Author(s): Anton Gladky, cf3f8d9
  • Date: 2013-10-30 20:56:33 UTC
  • mfrom: (20.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20131030205633-1f01r7hjce17d723
Tags: 1.05.0-2
[cf3f8d9] Pass -ftrack-macro-expansion=0 only if gcc>=4.8. (Closes: #726009)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
10
 
 
11
--- a/CMakeLists.txt
 
12
+++ b/CMakeLists.txt
 
13
@@ -39,6 +39,19 @@
 
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
 
22
 
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 ")
 
27
+ENDIF()
 
28
+
 
29
+#===========================================================
 
30
 IF (CMAKE_CXX_FLAGS)
 
31
   #If flags are set, add only neccessary flags
 
32
   IF (DEBUG)
 
33
@@ -46,7 +59,6 @@
 
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")
 
36
   ELSE (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")
 
39
   ENDIF (DEBUG)
 
40
 ELSE (CMAKE_CXX_FLAGS)