summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-09-13 11:36:33 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2022-09-13 15:47:01 (GMT)
commit90874a542e9d64d0a49326951defb2ed899bcbff (patch)
tree919edadb92ca1977f9ab73bb45d74a537024f58f /Modules
parent168e4491de07bc83f08d2fc09d627aa011847699 (diff)
downloadCMake-90874a542e9d64d0a49326951defb2ed899bcbff.zip
CMake-90874a542e9d64d0a49326951defb2ed899bcbff.tar.gz
CMake-90874a542e9d64d0a49326951defb2ed899bcbff.tar.bz2
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')
-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 e4d9b93..8ae6852 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 6adbb6e..e2fa2af 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)