[Interest] Qt 5.6.2 Git on Windows: -force-debug-info configure option triggers linker warning on usage

Rainer Wiesenfarth rainer_wiesenfarth at trimble.com
Wed Dec 7 11:06:27 CET 2016


Thanks, Gunnar, the patch works!

diff --git a/qmake/generators/win32/msvc_nmake.cpp
b/qmake/generators/win32/msvc_nmake.cpp
index ae139c2..41bec4c 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");

​Best regards
Rainer​

-- 
Software Engineer | Trimble Imaging Division
Rotebühlstraße 81 | 70178 Stuttgart | Germany
Office +49 711 22881 0 | Fax +49 711 22881 11 <+49%20711%202288111>
http://www.trimble.com/imaging/ | http://www.inpho.de/

Trimble Germany GmbH, Am Prime Parc 11, 65479 Raunheim
Eingetragen beim Amtsgericht Darmstadt unter HRB 83893,
Geschäftsführer: Dr. Frank Heimberg, Jürgen Kesper
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161207/0a788b6d/attachment.html>


More information about the Interest mailing list