From a8b6bf9a38021a4de3a439acb94518d8fab5d345 Mon Sep 17 00:00:00 2001 From: "William R. Dieter" Date: Tue, 8 Feb 2022 22:10:02 -0800 Subject: IntelLLVM: Add dependencies on system header files on Windows In commit a90d2a9eed (IntelLLVM: Add support for Intel LLVM-based compilers, 2020-11-02, v3.20.0-rc1~89^2~20) the IntelLLVM depfile generation flags were taken from `Platform/Windows-Intel-C`. Those flags were added by commit a624a3e1b3 (Ninja: Use deps=gcc for Intel Compiler on Windows, 2019-01-30, v3.14.0-rc1~30^2), which forgot to account for commit 6d74e7870b (Ninja: Add dependencies on system-provided header files, 2016-03-15, v3.6.0-rc1~265^2). The `-QMD` option generates Makefile dependencies. The `-QMMD` option generates Makefile dependencies, but excludes system header files. Part of the BuildDepends test includes a header, cmake_pch.hxx, that includes a second header, zot_pch.hxx. The test builds a pch file for cmake_pch.hxx, touches zot_pch.hxx, then verifes that cmake_pch.hxx.pch is regenerated based on the dependencies. The cmake_pch.hxx contains `#pragma system_header` before it includes zot_pch.hxx. `#pragma system_header` indicates that the portion of the file following the pragma is to be treated as a system header. When `-QMMD` is used to generate dependencies, the `#include` of zot_pch.hxx is ignored because it `-QMMD` says to ignore system headers. Using `-QMD` instead uses all headers when generating dependencies and causes this test to pass. The Clang configuration in Platform/Windows-Clang.cmake also uses the `-MD` option for generating pre-compiled headers, instead of `-MMD`. Signed-off-by: William R. Dieter --- Modules/Platform/Windows-IntelLLVM.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Platform/Windows-IntelLLVM.cmake b/Modules/Platform/Windows-IntelLLVM.cmake index b9ea037..8231e78 100644 --- a/Modules/Platform/Windows-IntelLLVM.cmake +++ b/Modules/Platform/Windows-IntelLLVM.cmake @@ -12,6 +12,6 @@ include(Platform/Windows-MSVC) macro(__windows_compiler_intel lang) __windows_compiler_msvc(${lang}) - set(CMAKE_DEPFILE_FLAGS_${lang} "-QMMD -QMT -QMF ") + set(CMAKE_DEPFILE_FLAGS_${lang} "-QMD -QMT -QMF ") set(CMAKE_${lang}_DEPFILE_FORMAT gcc) endmacro() -- cgit v0.12