]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Check for unused typedef warning and disable
authorMatthew Barr <matthew.barr@intel.com>
Mon, 18 Sep 2017 05:07:53 +0000 (15:07 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Mon, 18 Sep 2017 05:23:57 +0000 (15:23 +1000)
This affects older versions of Boost (1.58), and we were only disabling the
warning for g++.

Fixes #62.

CMakeLists.txt
unit/CMakeLists.txt

index 2520832b9295cad7b0c60ede06fa8888949befbe..b07aa1038b5c08a2b9328e63c86d01606c18084b 100644 (file)
@@ -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)
 
index e9d1821b29f823bf0b08ebec1553c3f8569b1da0..06cddebdac1e92b426a994e6af9869ba4fbbfb87 100644 (file)
@@ -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")