Modules: Fix ARMClang and TIClang language standard compile options

Unset irrelevant compile option variables in the following scripts:
  * `${CMAKE_ROOT}\Modules\Compiler\ARMClang-C.cmake`
  * `${CMAKE_ROOT}\Modules\Compiler\TIClang-C.cmake`
  * `${CMAKE_ROOT}\Modules\Compiler\TIClang-CXX.cmake`

These scripts all include either
`${CMAKE_ROOT}\Modules\Compiler\Clang-C.cmake` or
`${CMAKE_ROOT}\Modules\Compiler\Clang-CXX.cmake`, and those scripts
will set various compile option variables based on what the
standard version of Clang supports. However, these do not
necessarily apply to ARMClang and TIClang. This commit thus
explicitly unsets all of the compile option variables which are not
manually defined for these compilers.
This commit is contained in:
Tyler Nichols
2024-04-23 15:19:48 -06:00
committed by Brad King
parent 0ccc9f519d
commit 1dff17108d
3 changed files with 27 additions and 0 deletions

View File

@@ -21,3 +21,11 @@ set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
# Including the "${CMAKE_ROOT}/Modules/Compiler/Clang-C.cmake" script above may set several other compile option
# variables which do not necessarily apply here. So, we unset those variables accordingly.
unset(CMAKE_C17_STANDARD_COMPILE_OPTION)
unset(CMAKE_C17_EXTENSION_COMPILE_OPTION)
unset(CMAKE_C23_STANDARD_COMPILE_OPTION)
unset(CMAKE_C23_EXTENSION_COMPILE_OPTION)

View File

@@ -21,3 +21,11 @@ set(CMAKE_C99_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_C11_STANDARD_COMPILE_OPTION "-std=c11")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu11")
set(CMAKE_C11_STANDARD__HAS_FULL_SUPPORT ON)
# Including the "${CMAKE_ROOT}/Modules/Compiler/Clang-C.cmake" script above may set several other compile option
# variables which do not necessarily apply here. So, we unset those variables accordingly.
unset(CMAKE_C17_STANDARD_COMPILE_OPTION)
unset(CMAKE_C17_EXTENSION_COMPILE_OPTION)
unset(CMAKE_C23_STANDARD_COMPILE_OPTION)
unset(CMAKE_C23_EXTENSION_COMPILE_OPTION)

View File

@@ -23,3 +23,14 @@ set(CMAKE_CXX14_STANDARD__HAS_FULL_SUPPORT ON)
set(CMAKE_CXX17_STANDARD_COMPILE_OPTION "-std=c++17")
set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "-std=gnu++17")
# Including the "${CMAKE_ROOT}/Modules/Compiler/Clang-CXX.cmake" script above may set several other compile option
# variables which do not necessarily apply here. So, we unset those variables accordingly.
unset(CMAKE_CXX20_STANDARD_COMPILE_OPTION)
unset(CMAKE_CXX20_EXTENSION_COMPILE_OPTION)
unset(CMAKE_CXX23_STANDARD_COMPILE_OPTION)
unset(CMAKE_CXX23_EXTENSION_COMPILE_OPTION)
unset(CMAKE_CXX26_STANDARD_COMPILE_OPTION)
unset(CMAKE_CXX26_EXTENSION_COMPILE_OPTION)