diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2018-08-27 13:13:13 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2018-08-28 18:07:53 (GMT) |
commit | 83f2d4838877142f8daada6d84d091f7ad64d38b (patch) | |
tree | 4c8708f01d9ff542c57dafb9f3d6d6f26366170f /Modules/Compiler/Intel.cmake | |
parent | 363fffc736f723fc4a7bb3c8cd69e462eb9f937e (diff) | |
download | CMake-83f2d4838877142f8daada6d84d091f7ad64d38b.zip CMake-83f2d4838877142f8daada6d84d091f7ad64d38b.tar.gz CMake-83f2d4838877142f8daada6d84d091f7ad64d38b.tar.bz2 |
Respect CMAKE_<LANG>_COMPILER_ARG1 in CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND
AUTOMOC used to fail to generate ``moc_predefs.h`` when ``ccache`` was used
as a compiler starter by e.g. configuring a project with the environment
variable CXX="ccache g++".
The reason was that ``CMAKE_<LANG>_COMPILER_ARG1`` wasn't respected in the
definition of ``CMAKE_<LANG>_COMPILER_PREDEFINES_COMMAND`` for various
compilers. This is fixed by this patch.
Fixes #17275.
Diffstat (limited to 'Modules/Compiler/Intel.cmake')
-rw-r--r-- | Modules/Compiler/Intel.cmake | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/Compiler/Intel.cmake b/Modules/Compiler/Intel.cmake index 635ac4d..f2f16e0 100644 --- a/Modules/Compiler/Intel.cmake +++ b/Modules/Compiler/Intel.cmake @@ -25,6 +25,12 @@ else() string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -O3") string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -O2 -g") - set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}" "-QdM" "-P" "-Za" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp") + set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}") + if(CMAKE_${lang}_COMPILER_ARG1) + separate_arguments(_COMPILER_ARGS NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ARG1}") + list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND ${_COMPILER_ARGS}) + unset(_COMPILER_ARGS) + endif() + list(APPEND CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "-QdM" "-P" "-Za" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp") endmacro() endif() |