summaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2024-05-01 16:07:58 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2024-05-01 16:07:58 +0200
commit175931bccd2ee9b58b19f92b7f3ca38bba765621 (patch)
tree1def365dbbb467089f0b9ccffed88dc2ddd1de91 /test/CMakeLists.txt
parentd22d4a526fb5f20341d2deee58be3554041f0ab6 (diff)
CMake: simplify compiler detection for '-Wshadow' test
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 05d090ff0..692730db1 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -234,10 +234,8 @@ endif(OPENGL_FOUND)
# Its sole purpose is to issue compilation warnings during build time if
# variables are shadowed in public headers.
-fl_debug_var(CMAKE_CXX_COMPILER_ID)
-if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
- CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
- CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
+set(_compilers GNU Clang AppleClang)
+if(CMAKE_CXX_COMPILER_ID IN_LIST _compilers)
set(include_all "${CMAKE_CURRENT_BINARY_DIR}/include_all.h")
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)
endif() # GNU or Clang (-Wshadow test)
+unset(_compilers)
# *** EXPERIMENTAL ***