From 1a812637443772a188a52827e88b63350b663efc Mon Sep 17 00:00:00 2001 From: Matthew Barr Date: Mon, 18 Sep 2017 15:07:53 +1000 Subject: [PATCH] Check for unused typedef warning and disable This affects older versions of Boost (1.58), and we were only disabling the warning for g++. Fixes #62. --- CMakeLists.txt | 4 +++- unit/CMakeLists.txt | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2520832b..b07aa103 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,7 +255,7 @@ else() endif() if(CMAKE_COMPILER_IS_GNUCXX) - set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-unused-local-typedefs -Wno-maybe-uninitialized") + set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-maybe-uninitialized") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -fabi-version=0") endif () @@ -404,6 +404,8 @@ if (CXX_MISSING_DECLARATIONS) set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wmissing-declarations") endif() +CHECK_CXX_COMPILER_FLAG("-Wunused-local-typedefs" CXX_UNUSED_LOCAL_TYPEDEFS) + # gcc5 complains about this CHECK_CXX_COMPILER_FLAG("-Wunused-variable" CXX_WUNUSED_VARIABLE) diff --git a/unit/CMakeLists.txt b/unit/CMakeLists.txt index e9d1821b..06cddebd 100644 --- a/unit/CMakeLists.txt +++ b/unit/CMakeLists.txt @@ -20,6 +20,10 @@ if(CXX_WUNUSED_VARIABLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable") endif() +if (CXX_UNUSED_LOCAL_TYPEDEFS) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs") +endif() + if(CMAKE_COMPILER_IS_GNUCC) # spurious warnings? set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-array-bounds")