summaryrefslogtreecommitdiff
path: root/Modules/Platform
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-09-13 13:36:33 +0200
committerMarc Chevrier <marc.chevrier@gmail.com>2022-09-13 17:47:01 +0200
commit90874a542e9d64d0a49326951defb2ed899bcbff (patch)
tree919edadb92ca1977f9ab73bb45d74a537024f58f /Modules/Platform
parent168e4491de07bc83f08d2fc09d627aa011847699 (diff)
downloadcmake-90874a542e9d64d0a49326951defb2ed899bcbff.tar.gz
Intel classic compilers on Windows: use msvc style dependencies
Intel classic compilers generate erroneous dependencies when gcc style is used with paths containing spaces. So, fall back to the old way to generate dependencies by using option /showIncludes. Fixes: #23948
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/Windows-Intel-C.cmake11
-rw-r--r--Modules/Platform/Windows-Intel-CXX.cmake11
2 files changed, 10 insertions, 12 deletions
diff --git a/Modules/Platform/Windows-Intel-C.cmake b/Modules/Platform/Windows-Intel-C.cmake
index e4d9b93ee4..8ae6852932 100644
--- a/Modules/Platform/Windows-Intel-C.cmake
+++ b/Modules/Platform/Windows-Intel-C.cmake
@@ -19,9 +19,8 @@ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
endif()
-if("${CMAKE_SOURCE_DIR}${CMAKE_BINARY_DIR}" MATCHES " ")
- # The Intel compiler does not properly escape spaces in a depfile.
- # Fall back to msvc depfile format.
- set(CMAKE_DEPFILE_FLAGS_C "/showIncludes")
- set(CMAKE_C_DEPFILE_FORMAT msvc)
-endif()
+# The Intel compiler does not properly escape spaces in a depfile which can
+# occur in source and binary cmake paths as well as external include paths.
+# Until Intel fixes this bug, fall back unconditionally to msvc depfile format.
+set(CMAKE_DEPFILE_FLAGS_C "/showIncludes")
+set(CMAKE_C_DEPFILE_FORMAT msvc)
diff --git a/Modules/Platform/Windows-Intel-CXX.cmake b/Modules/Platform/Windows-Intel-CXX.cmake
index 6adbb6e193..e2fa2afaa4 100644
--- a/Modules/Platform/Windows-Intel-CXX.cmake
+++ b/Modules/Platform/Windows-Intel-CXX.cmake
@@ -20,9 +20,8 @@ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
endif()
-if("${CMAKE_SOURCE_DIR}${CMAKE_BINARY_DIR}" MATCHES " ")
- # The Intel compiler does not properly escape spaces in a depfile.
- # Fall back to msvc depfile format.
- set(CMAKE_DEPFILE_FLAGS_CXX "/showIncludes")
- set(CMAKE_CXX_DEPFILE_FORMAT msvc)
-endif()
+# The Intel compiler does not properly escape spaces in a depfile which can
+# occur in source and binary cmake paths as well as external include paths.
+# Until Intel fixes this bug, fall back unconditionally to msvc depfile format.
+set(CMAKE_DEPFILE_FLAGS_CXX "/showIncludes")
+set(CMAKE_CXX_DEPFILE_FORMAT msvc)