From d16d56a05ee9219ba6b7985b56a7bd69fb248875 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 28 Oct 2016 15:38:59 +0200 Subject: 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 --- qmake/generators/win32/msvc_nmake.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'qmake') 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"); -- cgit v1.2.3