it. It seems to only be available on recent (>=4.6) versions of gcc.
# Set some optimizations and tweaks
#
+include(CheckCCompilerFlag)
+
if(MSVC)
# Visual Studio
endif()
if(NOT APPLE)
- set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-unused-but-set-variable")
+ check_c_compiler_flag("-Wno-unused-but-set-variable" HAS_UNUSED_BUT_SET_VARIABLE_WARNING)
+ if(HAS_UNUSED_BUT_SET_VARIABLE_WARNING)
+ set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-unused-but-set-variable")
+ endif(HAS_UNUSED_BUT_SET_VARIABLE_WARNING)
endif()
if(APPLE)