Merge lp:~widelands-dev/widelands/GLVND_18_10 into lp:widelands

Proposed by Toni Förster
Status: Merged
Merged at revision: 8890
Proposed branch: lp:~widelands-dev/widelands/GLVND_18_10
Merge into: lp:widelands
Diff against target: 50 lines (+26/-2)
1 file modified
CMakeLists.txt (+26/-2)
To merge this branch: bzr merge lp:~widelands-dev/widelands/GLVND_18_10
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+356771@code.launchpad.net

Commit message

set CMP0072 to OLD for Ubuntu 18.10 when using GCC

Description of the change

Since it is only possible to compile with GLVND when using Clang on Ubuntu 18.10 we set CMP0072 to OLD behavior

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 4141. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/441954041.
Appveyor build 3938. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_GLVND_18_10-3938.

Revision history for this message
kaputtnik (franku) wrote :

Thanks for your hard work on this :-)

Have you tried the CMake variable CMAKE_SYSTEM or CMAKE_SYTEM_VERSION? From what i have read something like this should work also, without the need the call to lsb_release:

if (CMAKE_SYSTEM_VERSION MATCHES "Ubuntu 18.10")
 [...]

CMAKE_SYSTEM_VERSION should be the same as calling uname -r.

https://cmake.org/cmake/help/v3.0/manual/cmake-variables.7.html#variables-that-describe-the-system
https://cmake.org/cmake/help/v3.0/command/if.html

Compiling this branch now.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Now I know why one of your forum members has "Cmake is evil" in his signature...

LGTM, let's merge and see what the daily PPA will say.

@bunnybot merge

Revision history for this message
kaputtnik (franku) wrote :

Compiles here :-)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2018-10-14 20:56:48 +0000
3+++ CMakeLists.txt 2018-10-16 00:43:49 +0000
4@@ -3,7 +3,7 @@
5 cmake_minimum_required (VERSION 2.8.7)
6 cmake_policy(VERSION 2.8.7)
7
8-# This policy is not known to versions prior 3.1 and would result in errors,
9+# This policy is not known to versions prior 3.1 and would result in errors,
10 # if set on such systems. This can be removed when cmake_minimum_required is set
11 # to 3.1 or newer by using:
12 # cmake_policy(VERSION 3.1)
13@@ -11,12 +11,36 @@
14 cmake_policy(SET CMP0054 NEW)
15 endif(POLICY CMP0054)
16
17-# This policy is not known to versions prior 3.11 and would result in errors,
18+# This policy is not known to versions prior 3.11 and would result in errors,
19 # if set on such systems. This can be removed when cmake_minimum_required is set
20 # to 3.11 or newer by using:
21 # cmake_policy(VERSION 3.11)
22 if(POLICY CMP0072)
23 cmake_policy(SET CMP0072 NEW)
24+
25+ # On Ubuntu 18.10 we need to set this policy to OLD when GCC is used.
26+ #
27+ #TODO(stonerl): Check on later Ubuntu releases whether workaround this is
28+ # still needed or not.
29+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
30+ find_program(LSB_RELEASE_EXEC lsb_release)
31+ execute_process(COMMAND ${LSB_RELEASE_EXEC} -is
32+ OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT
33+ OUTPUT_STRIP_TRAILING_WHITESPACE
34+ )
35+ execute_process(COMMAND ${LSB_RELEASE_EXEC} -cs
36+ OUTPUT_VARIABLE RELEASE_CODENAME
37+ OUTPUT_STRIP_TRAILING_WHITESPACE
38+ )
39+ endif()
40+
41+ if (LSB_RELEASE_ID_SHORT STREQUAL "Ubuntu" AND
42+ RELEASE_CODENAME STREQUAL "cosmic" AND
43+ CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
44+ )
45+ cmake_policy(SET CMP0072 OLD)
46+ endif()
47+
48 endif(POLICY CMP0072)
49
50 include("${CMAKE_SOURCE_DIR}/cmake/WlFunctions.cmake")

Subscribers

People subscribed via source and target branches

to status/vote changes: