mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Check whether -Wno-unused-but-set-variable is supported before using
it. It seems to only be available on recent (>=4.6) versions of gcc.
This commit is contained in:
parent
9017c51e7f
commit
318a730c45
1 changed files with 6 additions and 1 deletions
|
@ -209,6 +209,8 @@ endif(BUILD_SERVER)
|
||||||
# Set some optimizations and tweaks
|
# Set some optimizations and tweaks
|
||||||
#
|
#
|
||||||
|
|
||||||
|
include(CheckCCompilerFlag)
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# Visual Studio
|
# Visual Studio
|
||||||
|
|
||||||
|
@ -236,7 +238,10 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT APPLE)
|
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()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue