summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Windows-Intel-CXX.cmake
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-12-01 13:05:06 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-12-01 14:50:01 (GMT)
commitf8d8faff8d01323d5a48a3b9be55cf9b6e10d5b4 (patch)
tree748c7eab8a29147749ccbf11f367dd0670b01136 /Modules/Platform/Windows-Intel-CXX.cmake
parenta22a8f1e36628f32485b4aebed7cd30ee40c5b4a (diff)
downloadCMake-f8d8faff8d01323d5a48a3b9be55cf9b6e10d5b4.zip
CMake-f8d8faff8d01323d5a48a3b9be55cf9b6e10d5b4.tar.gz
CMake-f8d8faff8d01323d5a48a3b9be55cf9b6e10d5b4.tar.bz2
Ninja Generators: Homogenize configuration with Makefiles
* Use same configuration variables to configure dependencies * Abstract Ninja deps format from compiler one
Diffstat (limited to 'Modules/Platform/Windows-Intel-CXX.cmake')
-rw-r--r--Modules/Platform/Windows-Intel-CXX.cmake22
1 files changed, 19 insertions, 3 deletions
diff --git a/Modules/Platform/Windows-Intel-CXX.cmake b/Modules/Platform/Windows-Intel-CXX.cmake
index 6539f64..ce33ae1 100644
--- a/Modules/Platform/Windows-Intel-CXX.cmake
+++ b/Modules/Platform/Windows-Intel-CXX.cmake
@@ -1,12 +1,28 @@
include(Platform/Windows-Intel)
set(_COMPILE_CXX " /TP")
__windows_compiler_intel(CXX)
-set(CMAKE_NINJA_DEPTYPE_CXX intel) # special value handled by CMake
+
set(CMAKE_DEPFILE_FLAGS_CXX "-QMMD -QMT <DEP_TARGET> -QMF <DEP_FILE>")
+set(CMAKE_CXX_DEPFILE_FORMAT gcc)
+
+if(CMAKE_GENERATOR MATCHES "^Ninja")
+ if(_CMAKE_NINJA_VERSION VERSION_LESS 1.9)
+ # This ninja version is too old to support the Intel depfile format.
+ # Fall back to msvc depfile format.
+ set(CMAKE_DEPFILE_FLAGS_CXX "/showIncludes")
+ set(CMAKE_CXX_DEPFILE_FORMAT msvc)
+ endif()
+endif()
if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
AND CMAKE_GENERATOR MATCHES "Makefiles|WMake")
# dependencies are computed by the compiler itself
- set(CMAKE_CXX_DEPFILE_FORMAT gcc)
- set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
+ 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()