diff options
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r-- | qmake/generators/win32/mingw_make.cpp | 7 | ||||
-rw-r--r-- | qmake/generators/win32/mingw_make.h | 4 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_nmake.cpp | 6 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 12 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.h | 4 |
5 files changed, 24 insertions, 9 deletions
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index d6d6b04148..6fcfe96380 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -46,8 +46,7 @@ QString MingwMakefileGenerator::escapeDependencyPath(const QString &path) const { QString ret = path; ret.replace('\\', "/"); // ### this shouldn't be here - ret.replace(' ', QLatin1String("\\ ")); - return ret; + return MakefileGenerator::escapeDependencyPath(ret); } QString MingwMakefileGenerator::getManifestFileForRcFile() const @@ -165,13 +164,13 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t) QString header = project->first("PRECOMPILED_HEADER").toQString(); QString cHeader = preCompHeaderOut + Option::dir_sep + "c"; t << escapeDependencyPath(cHeader) << ": " << escapeDependencyPath(header) << " " - << escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t") + << finalizeDependencyPaths(findDependencies(header)).join(" \\\n\t\t") << "\n\t" << mkdir_p_asstring(preCompHeaderOut) << "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << escapeFilePath(cHeader) << ' ' << escapeFilePath(header) << endl << endl; QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++"; t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " " - << escapeDependencyPaths(findDependencies(header)).join(" \\\n\t\t") + << finalizeDependencyPaths(findDependencies(header)).join(" \\\n\t\t") << "\n\t" << mkdir_p_asstring(preCompHeaderOut) << "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << escapeFilePath(cppHeader) << ' ' << escapeFilePath(header) << endl << endl; diff --git a/qmake/generators/win32/mingw_make.h b/qmake/generators/win32/mingw_make.h index ab9e5a9961..6f041cfd4a 100644 --- a/qmake/generators/win32/mingw_make.h +++ b/qmake/generators/win32/mingw_make.h @@ -39,8 +39,8 @@ public: MingwMakefileGenerator(); ~MingwMakefileGenerator(); protected: - QString escapeDependencyPath(const QString &path) const; - ProString escapeDependencyPath(const ProString &path) const { return MakefileGenerator::escapeDependencyPath(path); } + using MakefileGenerator::escapeDependencyPath; + virtual QString escapeDependencyPath(const QString &path) const; virtual ProString fixLibFlag(const ProString &lib); virtual QString getManifestFileForRcFile() const; bool writeMakefile(QTextStream &); diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index ccc2ea6d2b..92b4eb5054 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -321,7 +321,7 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t) QString precompRule = QString("-c -Yc -Fp%1 -Fo%2") .arg(escapeFilePath(precompPch), escapeFilePath(precompObj)); t << escapeDependencyPath(precompObj) << ": " << escapeDependencyPath(precompH) << ' ' - << escapeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t") + << finalizeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t") << "\n\t$(CXX) " + precompRule +" $(CXXFLAGS) $(INCPATH) -TP " << escapeFilePath(precompH) << endl << endl; } @@ -329,7 +329,7 @@ void NmakeMakefileGenerator::writeNmakeParts(QTextStream &t) QString precompRuleC = QString("-c -Yc -Fp%1 -Fo%2") .arg(escapeFilePath(precompPchC), escapeFilePath(precompObjC)); t << escapeDependencyPath(precompObjC) << ": " << escapeDependencyPath(precompH) << ' ' - << escapeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t") + << finalizeDependencyPaths(findDependencies(precompH)).join(" \\\n\t\t") << "\n\t$(CC) " + precompRuleC +" $(CFLAGS) $(INCPATH) -TC " << escapeFilePath(precompH) << endl << endl; } @@ -619,6 +619,8 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) } } else { manifest = fileFixify(manifest); + if (linkerSupportsEmbedding) + extraLFlags = "/MANIFEST:embed /MANIFESTINPUT:" + escapeFilePath(manifest); } const QString resourceId = (templateName == "app") ? "1" : "2"; diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 75bb5d236d..bca27b7044 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -773,6 +773,18 @@ QString Win32MakefileGenerator::escapeFilePath(const QString &path) const return ret; } +QString Win32MakefileGenerator::escapeDependencyPath(const QString &path) const +{ + QString ret = path; + if (!ret.isEmpty()) { + static const QRegExp criticalChars(QStringLiteral("([\t #])")); + if (ret.contains(criticalChars)) + ret = "\"" + ret + "\""; + debug_msg(2, "EscapeDependencyPath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData()); + } + return ret; +} + QString Win32MakefileGenerator::cQuoted(const QString &str) { QString ret = str; diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h index 4d5ee9812b..b85a6b67df 100644 --- a/qmake/generators/win32/winmakefile.h +++ b/qmake/generators/win32/winmakefile.h @@ -47,8 +47,10 @@ protected: virtual void writeObjectsPart(QTextStream &t); virtual void writeImplicitRulesPart(QTextStream &t); virtual void writeBuildRulesPart(QTextStream &); + using MakefileGenerator::escapeFilePath; virtual QString escapeFilePath(const QString &path) const; - ProString escapeFilePath(const ProString &path) const { return MakefileGenerator::escapeFilePath(path); } + using MakefileGenerator::escapeDependencyPath; + virtual QString escapeDependencyPath(const QString &path) const; virtual void writeRcFilePart(QTextStream &t); |