Merge lp:~bilalakhtar/unity/make-compilation-strict into lp:unity

Proposed by Bilal Akhtar
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merged at revision: 1227
Proposed branch: lp:~bilalakhtar/unity/make-compilation-strict
Merge into: lp:unity
Diff against target: 14 lines (+4/-0)
1 file modified
CMakeLists.txt (+4/-0)
To merge this branch: bzr merge lp:~bilalakhtar/unity/make-compilation-strict
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+62073@code.launchpad.net

This proposal supersedes a proposal from 2011-05-18.

Description of the change

Make compilation of Unity on GCC versions 4.5 and below, as strict as that on GCC 4.6 .

To post a comment you must log in.
Revision history for this message
Gord Allott (gordallott) wrote : Posted in a previous version of this proposal

actually seems to break gcc/g++ for version 4.5 and below as the option -fno-strict-enums does not exist

review: Needs Fixing
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

FYI, you can make check the GCC Version in CMake like this:

execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
                OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_GREATER 4.5 OR GCC_VERSION VERSION_EQUAL 4.3)
        set (CMAKE_CXX_FLAGS "-fno-strict-enums")
endif()

Revision history for this message
Bilal Akhtar (bilalakhtar) wrote :

There's no need to do as sam said, as the -fno-strict-enums is passed by default in GCC 4.6 and above.

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 2011-04-27 08:07:58 +0000
3+++ CMakeLists.txt 2011-05-24 04:39:22 +0000
4@@ -16,6 +16,10 @@
5 set (UNITY_VERSION "${UNITY_MAJOR}.${UNITY_MINOR}.${UNITY_MICRO}")
6 set (UNITY_API_VERSION "3.0")
7
8+set (CMAKE_CXX_FLAGS "-fno-permissive")
9+set (CMAKE_CXX_FLAGS_DEBUG "-fno-permissive")
10+set (CMAKE_CXX_FLAGS_RELEASE "-fno-permissive")
11+
12 #
13 # Niceties
14 #