Teach VisualStudioCCompiler.get_pch_use_args() to handle clang-cl

It seems that clang-cl isn't quite compatible with cl in the way it handles
pch, and when the precompiled header is used, the pathname of the header is
needed, not just its filename.

This fixes test\common\13 pch with clang-cl
pull/4250/head
Jon Turney 6 years ago
parent b5b7e5b94a
commit e820c66a4c
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81
  1. 2
      mesonbuild/compilers/c.py

@ -1316,6 +1316,8 @@ class VisualStudioCCompiler(CCompiler):
def get_pch_use_args(self, pch_dir, header): def get_pch_use_args(self, pch_dir, header):
base = os.path.basename(header) base = os.path.basename(header)
if self.id == 'clang-cl':
base = header
pchname = self.get_pch_name(header) pchname = self.get_pch_name(header)
return ['/FI' + base, '/Yu' + base, '/Fp' + os.path.join(pch_dir, pchname)] return ['/FI' + base, '/Yu' + base, '/Fp' + os.path.join(pch_dir, pchname)]

Loading…
Cancel
Save