← Back to team overview

widelands-dev team mailing list archive

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

 

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

Requested reviews:
  Widelands Developers (widelands-dev)

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

With the last update https://www.appveyor.com/updates Appveyor is now using a different virtualization with less memory.
So at the moment our 64bit-debug builds fail due to memory usage on linking.

This branch introduces the "-no-keep-memory" option in cmake for the linking process and activates it on Appveyor.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/appveyor_linking_memory into lp:widelands.
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2016-08-05 12:32:08 +0000
+++ CMakeLists.txt	2016-08-08 11:00:52 +0000
@@ -7,6 +7,7 @@
 option(OPTION_USE_GLBINDING "Use glbinding instead of GLEW" OFF)
 option(OPTION_GLEW_STATIC "Use static GLEW Library" OFF)
 option(OPTION_BUILD_WEBSITE_TOOLS "Build website-related tools" ON)
+option(OPTION_LINKING_REDUCE_MEMORY "Reduce memory consumption on linking" OFF)
 
 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
   message(FATAL_ERROR "Build directory and source directory must not be the same.")
@@ -184,13 +185,17 @@
 IF (WIN32)
   add_definitions(-DMINGW_HAS_SECURE_API)
   if (CMAKE_SIZEOF_VOID_P EQUAL 4)
-    set (CMAKE_EXE_LINKER_FLAGS "-Wl,--large-address-aware" CACHE STRING "Set by widelands CMakeLists.txt" FORCE)
+    set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--large-address-aware" CACHE STRING "Set by widelands CMakeLists.txt" FORCE)
     message (STATUS "Enabled large address awareness on mingw32")
   else (CMAKE_SIZEOF_VOID_P EQUAL 4)
     message (STATUS "Detected mingw32-w64")
   endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
 endif (WIN32)
 
+if (OPTION_LINKING_REDUCE_MEMORY)
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-no-keep-memory")
+endif()
+
 # on BSD this must be explicitly linked
 if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
   # Not needed on Debian GNU/kFreeBSD..

=== modified file 'appveyor.yml'
--- appveyor.yml	2016-05-04 17:23:16 +0000
+++ appveyor.yml	2016-08-08 11:00:52 +0000
@@ -32,7 +32,7 @@
   - cmd: md build
   - cmd: cd build
   - cmd: echo %APPVEYOR_BUILD_VERSION%_%CONFIGURATION%_%PLATFORM% > %APPVEYOR_BUILD_FOLDER%\WL_RELEASE
-  - cmd: "cmake -G \"Ninja\" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DOPTION_USE_GLBINDING=ON %APPVEYOR_BUILD_FOLDER%"
+  - cmd: "cmake -G \"Ninja\" -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DOPTION_USE_GLBINDING=ON -DOPTION_LINKING_REDUCE_MEMORY=ON %APPVEYOR_BUILD_FOLDER%"
   - cmd: ninja
 
 on_success:


Follow ups