mirror of
https://github.com/fltk/fltk.git
synced 2026-05-27 10:57:58 +08:00
CMake: simplify compiler detection for '-Wshadow' test
This commit is contained in:
+3
-4
@@ -234,10 +234,8 @@ endif(OPENGL_FOUND)
|
|||||||
# Its sole purpose is to issue compilation warnings during build time if
|
# Its sole purpose is to issue compilation warnings during build time if
|
||||||
# variables are shadowed in public headers.
|
# variables are shadowed in public headers.
|
||||||
|
|
||||||
fl_debug_var(CMAKE_CXX_COMPILER_ID)
|
set(_compilers GNU Clang AppleClang)
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
|
if(CMAKE_CXX_COMPILER_ID IN_LIST _compilers)
|
||||||
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
|
|
||||||
CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
|
||||||
|
|
||||||
set(include_all "${CMAKE_CURRENT_BINARY_DIR}/include_all.h")
|
set(include_all "${CMAKE_CURRENT_BINARY_DIR}/include_all.h")
|
||||||
file(WRITE ${include_all} "/* DO NOT EDIT - this file is created by CMake */\n")
|
file(WRITE ${include_all} "/* DO NOT EDIT - this file is created by CMake */\n")
|
||||||
@@ -259,6 +257,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
|
|||||||
set_target_properties(shadow_variables PROPERTIES COMPILE_FLAGS -Wshadow)
|
set_target_properties(shadow_variables PROPERTIES COMPILE_FLAGS -Wshadow)
|
||||||
|
|
||||||
endif() # GNU or Clang (-Wshadow test)
|
endif() # GNU or Clang (-Wshadow test)
|
||||||
|
unset(_compilers)
|
||||||
|
|
||||||
|
|
||||||
# *** EXPERIMENTAL ***
|
# *** EXPERIMENTAL ***
|
||||||
|
|||||||
Reference in New Issue
Block a user