diff options
author | Tyler Nichols <tylerbrawl@gmail.com> | 2024-04-23 21:19:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-04-30 15:05:03 (GMT) |
commit | 1dff17108d542f72e2ad7115ba2a231a22006268 (patch) | |
tree | 5a1079355725fcfa42715b4dec35b1fafcd6145a | |
parent | 0ccc9f519dc00891fadb9e9189a652013b7c30e2 (diff) | |
download | CMake-1dff17108d542f72e2ad7115ba2a231a22006268.zip CMake-1dff17108d542f72e2ad7115ba2a231a22006268.tar.gz CMake-1dff17108d542f72e2ad7115ba2a231a22006268.tar.bz2 |
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.
-rw-r--r-- | Modules/Compiler/ARMClang-C.cmake | 8 | ||||
-rw-r--r-- | Modules/Compiler/TIClang-C.cmake | 8 | ||||
-rw-r--r-- | Modules/Compiler/TIClang-CXX.cmake | 11 |
3 files changed, 27 insertions, 0 deletions
diff --git a/Modules/Compiler/ARMClang-C.cmake b/Modules/Compiler/ARMClang-C.cmake index 01c4cea..643fdad 100644 --- a/Modules/Compiler/ARMClang-C.cmake +++ b/Modules/Compiler/ARMClang-C.cmake @@ -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) diff --git a/Modules/Compiler/TIClang-C.cmake b/Modules/Compiler/TIClang-C.cmake index 2721fef..30e6b5d 100644 --- a/Modules/Compiler/TIClang-C.cmake +++ b/Modules/Compiler/TIClang-C.cmake @@ -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) diff --git a/Modules/Compiler/TIClang-CXX.cmake b/Modules/Compiler/TIClang-CXX.cmake index 860bb42..4fb2d70 100644 --- a/Modules/Compiler/TIClang-CXX.cmake +++ b/Modules/Compiler/TIClang-CXX.cmake @@ -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) |