CMAKE_COMPILER_IS_*: Replace with CMAKE_<LANG>_COMPILER_ID

Variables such as CMAKE_COMPILER_IS_GNUCC are documented as
obsolete/deprecated and ideally shouldn't be used in the code anymore
to have clearer compiler identifications.

In the past QCC compiler was identified as GNU and also had this
variable set to 1 (see policy CMP0047).  Same still applies for LCC
compiler (see policy CMP0129).
This commit is contained in:
Peter Kokot
2025-03-28 22:36:58 +01:00
parent 7885d5edd9
commit 50e57aa4ca
28 changed files with 35 additions and 39 deletions

View File

@@ -133,7 +133,7 @@ endif()
add_custom_target(notInAllCustom)
add_dependencies(notInAllCustom notInAllExe)
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX
if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|LCC)$" AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX
AND NOT XCODE) # XCODE is excluded due to #15687
add_executable(testSystemDir testSystemDir.cxx)
set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror")