2

We generate our PCH as a preprocess step before compile time and then force include the PCH into every file in the project. This works fine for us with MSVC cl but clang-cl is checking to see if the PCH is included in the sources (excluded by design).

I get the following error:

fatal error: #include of 'pch.hxx' not seen while attempting to use precompiled header

Shouldn't clang-cl detect the /FI (or /clang:-include) as a header within the source?

Dan Cobban
  • 21
  • 1
  • check where does your preprocessor generate `pch.hxx` and then ensure the the path is included in compilation step – rajeshnair Aug 07 '19 at 07:54
  • Thank you for your reply. I have verified that all path information is correct. I removed the absolute path information generated by cmake from the description to make the post clearer. The PCH generater we are using is [cotire](https://github.com/sakra/cotire) a very simply library. – Dan Cobban Aug 08 '19 at 18:06

1 Answers1

0

clang-cl should (and does) treat /FI arguments as include lines. Can you paste the compile command that's failing? Maybe you're passing slightly different paths to /Yu and /Fi?

thakis
  • 5,405
  • 1
  • 33
  • 33