summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2016-10-28 15:38:59 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2016-10-28 14:37:11 +0000
commitd16d56a05ee9219ba6b7985b56a7bd69fb248875 (patch)
treee0e5ae7126cdd3979e52a9b8af8e428b08313688 /qmake
parent4c00246fea63c348a2992f5a54499f2928bf0605 (diff)
MSVC: Fix installation of PDB files for static libraries
Commit 3d3d65f5 separated the PDB files for compiling and linking. Only the PDB file the linker produces would be installed. However, this does not work for static libraries as the LIB tool does not create a PDB file from the compiler's PDB file. This patch turns the separation between PDB files off for static libraries. Task-number: QTBUG-56594 Change-Id: I08dcb7889c67b2f6370efa1ee19be8558355bbc9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index ae139c23be..41bec4c36d 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -409,14 +409,21 @@ void NmakeMakefileGenerator::init()
project->values("QMAKE_DISTCLEAN").append(tgt + ".lib");
}
if (project->isActiveConfig("debug_info")) {
- // Add the compiler's PDB file.
- QString pdbfile = var("OBJECTS_DIR") + project->first("TARGET") + ".vc.pdb";
+ QString pdbfile;
+ QString distPdbFile = tgt + ".pdb";
+ if (project->isActiveConfig("staticlib")) {
+ // For static libraries, the compiler's pdb file and the dist pdb file are the same.
+ pdbfile = distPdbFile;
+ } else {
+ // Use $${TARGET}.vc.pdb in the OBJECTS_DIR for the compiler and
+ // $${TARGET}.pdb (the default) for the linker.
+ 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_CLEAN").append(pdbfile);
- // Add the linker's PDB file to the distclean target.
- project->values("QMAKE_DISTCLEAN").append(tgt + ".pdb");
+ project->values("QMAKE_DISTCLEAN").append(distPdbFile);
}
if (project->isActiveConfig("debug")) {
project->values("QMAKE_CLEAN").append(tgt + ".ilk");