From 88f1d400c070fdd95d00298584c6ac18cf087a14 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 5 Nov 2016 03:49:09 +0530 Subject: Fix debug PCH builds with MSVC 2012 and later With MSVC 2013 and newer, using pre-compiled headers with .pdb debugging fails with the following error message: fatal error C1041: cannot open program database '[...]\prog.pdb'; if multiple CL.EXE write to the same .PDB file, please use /FS So we use /FS when PCH is enabled. When PCH is enabled and debugging is disabled, this will have no effect since .pdb files will not be written. --- mesonbuild/backend/ninjabackend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/backend') diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 63380bd..af96f3d 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1694,9 +1694,9 @@ rule FORTRAN_DEP_HACK if target.has_pch(): tfilename = self.get_target_filename_abs(target) - return compiler.get_compile_debugfile_args(tfilename) + return compiler.get_compile_debugfile_args(tfilename, pch=True) else: - return compiler.get_compile_debugfile_args(objfile) + return compiler.get_compile_debugfile_args(objfile, pch=False) def get_link_debugfile_args(self, linker, target, outname): return linker.get_link_debugfile_args(outname) -- cgit v1.1