Merge lp:~hjd/widelands/nullptr into lp:widelands

Proposed by Hans Joachim Desserud
Status: Merged
Merged at revision: 6655
Proposed branch: lp:~hjd/widelands/nullptr
Merge into: lp:widelands
Diff against target: 25 lines (+11/-3)
1 file modified
CMakeLists.txt (+11/-3)
To merge this branch: bzr merge lp:~hjd/widelands/nullptr
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+176063@code.launchpad.net

Description of the change

I tested with adding -Dnullptr=NULL to the compilerflags which made it build again on 10.04.

The following change in cmake should add it for gcc versions older than 4.6. I'll be the first to admit this patch, isn't pretty but none of the alternatives seemed a lot better either.

Not done extensive testing with this, but seems to be set only when it should.

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

Lgtm.

review: Approve
Revision history for this message
SirVer (sirver) wrote :

And merged. Thanks for taking care of this hjd!

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 2013-07-21 14:23:14 +0000
3+++ CMakeLists.txt 2013-07-21 15:26:27 +0000
4@@ -173,10 +173,18 @@
5 if(CMAKE_COMPILER_IS_GNUCXX)
6 EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
7 if (GCC_VERSION VERSION_LESS 4.7)
8- if (NOT WIN32)
9- set (PARAMETER_COMPILERFLAG_CXXSTD "-std=c++0x")
10+ if (GCC_VERSION VERSION_LESS 4.6)
11+ if (NOT WIN32)
12+ set (PARAMETER_COMPILERFLAG_CXXSTD "-std=c++0x -Dnullptr=NULL")
13+ else()
14+ set (PARAMETER_COMPILERFLAG_CXXSTD "-std=gnu++0x -Dnullptr=NULL")
15+ endif()
16 else()
17- set (PARAMETER_COMPILERFLAG_CXXSTD "-std=gnu++0x")
18+ if (NOT WIN32)
19+ set (PARAMETER_COMPILERFLAG_CXXSTD "-std=c++0x")
20+ else()
21+ set (PARAMETER_COMPILERFLAG_CXXSTD "-std=gnu++0x")
22+ endif()
23 endif()
24 endif()
25 endif()

Subscribers

People subscribed via source and target branches

to status/vote changes: