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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-07-21 14:23:14 +0000
+++ CMakeLists.txt 2013-07-21 15:26:27 +0000
@@ -173,10 +173,18 @@
173if(CMAKE_COMPILER_IS_GNUCXX)173if(CMAKE_COMPILER_IS_GNUCXX)
174 EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)174 EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
175 if (GCC_VERSION VERSION_LESS 4.7)175 if (GCC_VERSION VERSION_LESS 4.7)
176 if (NOT WIN32)176 if (GCC_VERSION VERSION_LESS 4.6)
177 set (PARAMETER_COMPILERFLAG_CXXSTD "-std=c++0x")177 if (NOT WIN32)
178 set (PARAMETER_COMPILERFLAG_CXXSTD "-std=c++0x -Dnullptr=NULL")
179 else()
180 set (PARAMETER_COMPILERFLAG_CXXSTD "-std=gnu++0x -Dnullptr=NULL")
181 endif()
178 else()182 else()
179 set (PARAMETER_COMPILERFLAG_CXXSTD "-std=gnu++0x")183 if (NOT WIN32)
184 set (PARAMETER_COMPILERFLAG_CXXSTD "-std=c++0x")
185 else()
186 set (PARAMETER_COMPILERFLAG_CXXSTD "-std=gnu++0x")
187 endif()
180 endif()188 endif()
181 endif()189 endif()
182endif()190endif()

Subscribers

People subscribed via source and target branches

to status/vote changes: