diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-06-07 16:18:49 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-06-15 12:28:01 +0000 |
commit | 3d3d65f538fa22eb8c5d9c8a4bad53bf79515848 (patch) | |
tree | d414393d3a16b23d0efaa96984bf29d46bef25d2 | |
parent | e3051e6591ca50c6f3fa7cbc5eba935ce6f04ad9 (diff) |
Use separate PDB files for compiling and linking in MSVC builds
The two PDB files that the MSVC compiler and linker create are supposed
to be handled differently and should not share the same file path.
Using the same file path for both can result in corrupted PDB files and
longer build times.
Use $${TARGET}.vc.pdb in the OBJECTS_DIR for the compiler and
$${TARGET}.pdb (the default) for the linker.
Task-number: QTBUG-53895
Change-Id: I31f06d4a674a3aa2afe5b30499bae820e5caf2c4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
-rw-r--r-- | qmake/generators/win32/msvc_nmake.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index f7a5019f8b..31abed57ef 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -409,11 +409,14 @@ void NmakeMakefileGenerator::init() project->values("QMAKE_DISTCLEAN").append(tgt + ".lib"); } if (project->isActiveConfig("debug_info")) { - QString pdbfile = tgt + ".pdb"; + // Add the compiler's PDB file. + QString pdbfile = var("OBJECTS_DIR") + project->first("TARGET") + ".vc.pdb"; QString escapedPdbFile = escapeFilePath(pdbfile); project->values("QMAKE_CFLAGS").append("/Fd" + escapedPdbFile); project->values("QMAKE_CXXFLAGS").append("/Fd" + escapedPdbFile); - project->values("QMAKE_DISTCLEAN").append(pdbfile); + project->values("QMAKE_CLEAN").append(pdbfile); + // Add the linker's PDB file to the distclean target. + project->values("QMAKE_DISTCLEAN").append(tgt + ".pdb"); } if (project->isActiveConfig("debug")) { project->values("QMAKE_CLEAN").append(tgt + ".ilk"); |