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
This commit is contained in:
Marc Chevrier
2022-09-13 13:36:33 +02:00
parent 168e4491de
commit 90874a542e
2 changed files with 10 additions and 12 deletions

View File

@@ -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)

View File

@@ -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)