summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/IBMClang.cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2022-11-16 12:08:31 (GMT)
committerJoerg Bornemann <joerg.bornemann@qt.io>2022-11-16 12:08:31 (GMT)
commitd538cb0e1890f15e2ea4b3433f4cc0d46f57e62f (patch)
treebad36e01c34153610812a00f92678417bc1061d2 /Modules/Compiler/IBMClang.cmake
parentb7ab39bf59c1b68140f1884676a2cfdaee2f7b41 (diff)
downloadCMake-d538cb0e1890f15e2ea4b3433f4cc0d46f57e62f.zip
CMake-d538cb0e1890f15e2ea4b3433f4cc0d46f57e62f.tar.gz
CMake-d538cb0e1890f15e2ea4b3433f4cc0d46f57e62f.tar.bz2
Only initialize CMAKE_CXX_COMPILER_PREDEFINES_COMMAND
Don't initialize the other CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND variables. The only language variant that is used is CMAKE_CXX_COMPILER_PREDEFINES_COMMAND, and the other language variants contained invalid, namely C++-specific commands. Fixes: #23968
Diffstat (limited to 'Modules/Compiler/IBMClang.cmake')
-rw-r--r--Modules/Compiler/IBMClang.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/Compiler/IBMClang.cmake b/Modules/Compiler/IBMClang.cmake
index 9ed7658..a9d760f 100644
--- a/Modules/Compiler/IBMClang.cmake
+++ b/Modules/Compiler/IBMClang.cmake
@@ -36,7 +36,7 @@ macro(__compiler_ibmclang lang)
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ")
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP)
- if(CMAKE_${lang}_COMPILER_TARGET)
+ if(CMAKE_${lang}_COMPILER_TARGET AND "${lang}" STREQUAL "CXX")
list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "--target=${CMAKE_${lang}_COMPILER_TARGET}")
endif()
@@ -66,7 +66,9 @@ macro(__compiler_ibmclang lang)
"\"${__ranlib}\" <TARGET>"
)
- list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
+ if("${lang}" STREQUAL "CXX")
+ list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
+ endif()
set(CMAKE_PCH_EXTENSION .pch)