]> git.mxchange.org Git - simgear.git/commitdiff
cmake: prevent Boost barfing out too many warns
authorStanislaw Halik <sthalik@misaki.pl>
Wed, 2 Oct 2013 18:35:38 +0000 (20:35 +0200)
committerJames Turner <zakalawe@mac.com>
Thu, 3 Oct 2013 20:49:38 +0000 (21:49 +0100)
CMakeLists.txt

index 3bbee824566ec92a6d44383be3d6400864ad733d..440f147eea00552149bac4b491a8bc7018033e55 100644 (file)
@@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6.4)
 include (CheckFunctionExists)
 include (CheckIncludeFile)
 include (CheckCXXSourceCompiles)
-
+include (CheckCXXCompilerFlag)
 
 project(SimGear)
 
@@ -314,6 +314,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
    set(WARNING_FLAGS_C   "-Wall")
 endif()
 
+if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+# boost goes haywire wrt static asserts
+    check_cxx_compiler_flag(-Wno-unused-local-typedefs HAS_NOWARN_UNUSED_TYPEDEFS)
+    if(HAS_NOWARN_UNUSED_TYPEDEFS)
+        set(WARNING_FLAGS_CXX " ${WARNING_FLAGS_CXX} -Wno-unused-local-typedefs")
+    endif()
+endif()
+
 if(WIN32)
 
     if(MINGW)