← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/gcc63 into lp:widelands

 

Tino has proposed merging lp:~widelands-dev/widelands/gcc63 into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1668200 in widelands: "Segfault on exit with GCC 6.3.0 Release Builds"
  https://bugs.launchpad.net/widelands/+bug/1668200

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/gcc63/+merge/318374

Quick workaround for segfaulting builds with GCC 6.3.0 (on Appveyor).
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/gcc63 into lp:widelands.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2017-02-14 18:17:38 +0000
+++ CMakeLists.txt	2017-02-27 15:34:50 +0000
@@ -93,11 +93,21 @@
 if(CMAKE_BUILD_TYPE STREQUAL "Debug")
   set(WL_DEBUG_FLAGS "-g -DDEBUG")
 elseif(CMAKE_BUILD_TYPE STREQUAL "Release")
-  set(WL_OPTIMIZE_FLAGS "-O3")
+  if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.3))
+    message(STATUS "GCC 6.3.0 breaks -03, setting -02")
+    set(WL_OPTIMIZE_FLAGS "-O2")
+  else()
+    set(WL_OPTIMIZE_FLAGS "-O3")
+  endif ()
   set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
 elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
-  set(WL_OPTIMIZE_FLAGS "-O3")
-  set(WL_DEBUG_FLAGS "-g -DNDEBUG -DNOPARACHUTE")
+  if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 6.3.0))
+    message(STATUS "GCC 6.3.0 breaks -03, setting -02")
+    set(WL_OPTIMIZE_FLAGS "-O2")
+  else()
+    set(WL_OPTIMIZE_FLAGS "-O3")
+  endif ()
+  set(WL_DEBUG_FLAGS "-DNDEBUG -DNOPARACHUTE")
 else()
   message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
 endif()


Follow ups