summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/makefiledeps.cpp5
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp15
2 files changed, 15 insertions, 5 deletions
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index 67c8219d4b..3140b045a1 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -46,6 +46,7 @@
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <limits.h>
#if defined(_MSC_VER) && _MSC_VER >= 1400
#include <share.h>
#endif
@@ -986,9 +987,11 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file)
continue;
int matchlen = 0, extralines = 0;
+ size_t needle_len = strlen(interesting[interest]);
+ Q_ASSERT(needle_len <= INT_MAX);
if (matchWhileUnsplitting(buffer, buffer_len, y,
interesting[interest],
- strlen(interesting[interest]),
+ static_cast<int>(needle_len),
&matchlen, &extralines)
&& y + matchlen < buffer_len
&& !isCWordChar(buffer[y + matchlen])) {
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 029092fdaa..1739f66453 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -374,14 +374,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");