Fixes strict compilation with gcc-4.8 and CMake.

In gcc-4.8 there will be a new warning -Wunused-local-typedefs. This
warning is triggered by boost's static asserts, causing strict
compilation to fail when using this compiler.

Note the compiler is not officially released yet so used a recent
snapshot.
This commit is contained in:
Mark de Wever 2012-06-09 21:41:05 +00:00
parent 29ac897e34
commit ca6b656d25
2 changed files with 10 additions and 0 deletions

View file

@ -9,6 +9,8 @@
# set minimum version
cmake_minimum_required(VERSION 2.6.0)
include(CheckCXXCompilerFlag)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0005 OLD)
endif(COMMAND cmake_policy)
@ -122,6 +124,13 @@ if(CMAKE_COMPILER_IS_GNUCXX)
if(ENABLE_STRICT_COMPILATION)
# The current unit test code breaks strict aliasing with g++ 4.4.
set(STRICT_FLAGS "-Werror -Wno-strict-aliasing")
# This flag is/will be added in gcc-4.8 and fails with BOOST_STATIC_ASSERT
check_cxx_compiler_flag("-Wunused-local-typedefs" HAS_COMPILER_FLAG_WUNUSED_LOCAL_TYPEDEFS)
if(HAS_COMPILER_FLAG_WUNUSED_LOCAL_TYPEDEFS)
set(STRICT_FLAGS "${STRICT_FLAGS} -Wno-unused-local-typedefs")
endif(HAS_COMPILER_FLAG_WUNUSED_LOCAL_TYPEDEFS)
else(ENABLE_STRICT_COMPILATION)
set(STRICT_FLAGS "")
endif(ENABLE_STRICT_COMPILATION)

View file

@ -310,6 +310,7 @@ Version 1.11.0-svn:
* Added: UNREACHABLE_CODE macro.
* Added: TELEPORT animation macros usable by any units
* Added: CMake option ENABLE_SHARED_LIBRARIES.
* Fixed: Allow strict compilation with CMake using the upcoming gcc-4.8.
Version 1.10.0:
* Campaigns: