Skip to content

IntelLLVM: Add dependencies on system header files on Windows

William R. Dieter requested to merge williamr/cmake:pch-opts into master

In !5594 (merged) the IntelLLVM depfile generation flags were taken from Platform/Windows-Intel-C. Those flags were added by !2893 (merged), which forgot to account for commit 6d74e787 (Ninja: Add dependencies on system-provided header files).

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.

Backport: release
Topic-rename: IntelLLVM-depfile-flags

Edited by Brad King

Merge request reports