From: Stanislaw Halik Date: Wed, 2 Oct 2013 18:35:38 +0000 (+0200) Subject: cmake: prevent Boost barfing out too many warns X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0186cbb7b7ab233de81ddaaa8276bc53e7d97177;p=simgear.git cmake: prevent Boost barfing out too many warns --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bbee824..440f147e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)