From 1dff17108d542f72e2ad7115ba2a231a22006268 Mon Sep 17 00:00:00 2001 From: Tyler Nichols Date: Tue, 23 Apr 2024 15:19:48 -0600 Subject: 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. --- Modules/Compiler/ARMClang-C.cmake | 8 ++++++++ Modules/Compiler/TIClang-C.cmake | 8 ++++++++ Modules/Compiler/TIClang-CXX.cmake | 11 +++++++++++ 3 files changed, 27 insertions(+) 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) -- cgit v0.12