Skip to content

Commit

Permalink
Check whether -Wno-unused-but-set-variable is supported before using
Browse files Browse the repository at this point in the history
it. It seems to only be available on recent (>=4.6) versions of gcc.
  • Loading branch information
AMDmi3 committed Aug 1, 2011
1 parent 9017c51 commit 318a730
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ endif(BUILD_SERVER)
# Set some optimizations and tweaks
#

include(CheckCCompilerFlag)

if(MSVC)
# Visual Studio

Expand Down Expand Up @@ -236,7 +238,10 @@ else()
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)
Expand Down

0 comments on commit 318a730

Please sign in to comment.