FLTK logo

[master] 175931b - CMake: simplify compiler detection for '-Wshadow' test

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 175931b - CMake: simplify compiler detection for '-Wshadow' test "Albrecht Schlosser" 07:17 May 01  
 
commit 175931bccd2ee9b58b19f92b7f3ca38bba765621
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Wed May 1 16:07:58 2024 +0200
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Wed May 1 16:07:58 2024 +0200

    CMake: simplify compiler detection for '-Wshadow' test

 test/CMakeLists.txt | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git test/CMakeLists.txt test/CMakeLists.txt
index 05d090f..692730d 100644
--- test/CMakeLists.txt
+++ 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 ***
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.