diff options
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r-- | qmake/generators/win32/mingw_make.cpp | 21 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_nmake.cpp | 9 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.cpp | 10 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 11 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 21 |
5 files changed, 57 insertions, 15 deletions
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 7990986fd8..1665e23f40 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -343,7 +343,7 @@ void MingwMakefileGenerator::writeLibsPart(QTextStream &t) if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { t << "LIB = " << var("QMAKE_LIB") << endl; } else { - t << "LINK = " << var("QMAKE_LINK") << endl; + t << "LINKER = " << var("QMAKE_LINK") << endl; t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; t << "LIBS = " << var("QMAKE_LIBS").replace(QRegExp("(\\slib|^lib)")," -l") << ' ' @@ -405,7 +405,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t) t << "\n\t" << objectsLinkLine << " " ; } } else if (project->first("TEMPLATE") != "aux") { - t << "\n\t" << "$(LINK) $(LFLAGS) -o $(DESTDIR_TARGET) " << objectsLinkLine << " " << " $(LIBS)"; + t << "\n\t" << "$(LINKER) $(LFLAGS) -o $(DESTDIR_TARGET) " << objectsLinkLine << " " << " $(LIBS)"; } if(!project->isEmpty("QMAKE_POST_LINK")) t << "\n\t" <<var("QMAKE_POST_LINK"); @@ -416,14 +416,23 @@ void MingwMakefileGenerator::writeRcFilePart(QTextStream &t) { const QString rc_file = fileFixify(project->first("RC_FILE").toQString()); - QString incPathStr = fileInfo(rc_file).path(); - if (incPathStr != "." && QDir::isRelativePath(incPathStr)) - incPathStr.prepend("./"); + ProStringList rcIncPaths = project->values("RC_INCLUDEPATH"); + rcIncPaths.prepend(fileInfo(rc_file).path()); + QString incPathStr; + for (int i = 0; i < rcIncPaths.count(); ++i) { + const ProString &path = rcIncPaths.at(i); + if (path.isEmpty()) + continue; + incPathStr += QStringLiteral(" --include-dir="); + if (path != "." && QDir::isRelativePath(path.toQString())) + incPathStr += "./"; + incPathStr += escapeFilePath(path); + } if (!rc_file.isEmpty()) { t << escapeDependencyPath(var("RES_FILE")) << ": " << rc_file << "\n\t" << var("QMAKE_RC") << " -i " << rc_file << " -o " << var("RES_FILE") - << " --include-dir=" << incPathStr << " $(DEFINES)" << endl << endl; + << incPathStr << " $(DEFINES)" << endl << endl; } } diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index d982d8bcf0..d899c707d4 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -409,6 +409,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) manifest = escapeFilePath(fileFixify(manifest)); } + const QString resourceId = (templateName == "app") ? "1" : "2"; const bool incrementalLinking = project->values("QMAKE_LFLAGS").toQStringList().filter(QRegExp("(/|-)INCREMENTAL:NO")).isEmpty(); if (incrementalLinking) { // Link a resource that contains the manifest without modifying the exe/dll after linking. @@ -418,7 +419,8 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) QString manifest_bak = escapeFilePath(target + "_manifest.bak"); project->values("QMAKE_CLEAN") << manifest_rc << manifest_res; - t << "\n\techo 1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ " + t << "\n\techo " << resourceId + << " /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ " << cQuoted(unescapeFilePath(manifest)) << ">" << manifest_rc; if (generateManifest) { @@ -441,7 +443,8 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) // directly embed the manifest in the executable after linking t << "\n\t"; writeLinkCommand(t, extraLFlags); - t << "\n\t" << "mt.exe /nologo /manifest " << manifest << " /outputresource:$(DESTDIR_TARGET);1"; + t << "\n\t" << "mt.exe /nologo /manifest " << manifest + << " /outputresource:$(DESTDIR_TARGET);" << resourceId; } } else { t << "\n\t"; @@ -462,7 +465,7 @@ void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t) void NmakeMakefileGenerator::writeLinkCommand(QTextStream &t, const QString &extraFlags, const QString &extraInlineFileContent) { - t << "$(LINK) $(LFLAGS)"; + t << "$(LINKER) $(LFLAGS)"; if (!extraFlags.isEmpty()) t << ' ' << extraFlags; t << " /OUT:$(DESTDIR_TARGET) @<<\n" diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 739e423b8c..0d67fcac85 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2408,6 +2408,16 @@ void VCProjectWriter::write(XmlOutput &xml, VCProjectSingleConfig &tool) outputFilter(tempProj, xml, "TranslationFiles"); outputFilter(tempProj, xml, "FormFiles"); outputFilter(tempProj, xml, "ResourceFiles"); + + QSet<QString> extraCompilersInProject; + for (int i = 0; i < tool.ExtraCompilersFiles.count(); ++i) { + const QString &compilerName = tool.ExtraCompilersFiles.at(i).Name; + if (!extraCompilersInProject.contains(compilerName)) { + extraCompilersInProject += compilerName; + tempProj.ExtraCompilers += compilerName; + } + } + for (int x = 0; x < tempProj.ExtraCompilers.count(); ++x) { outputFilter(tempProj, xml, tempProj.ExtraCompilers.at(x)); } diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 1e3f66a9c0..9f14b61f49 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1072,6 +1072,17 @@ void VcprojGenerator::initResourceTool() VCConfiguration &conf = vcProject.Configuration; conf.resource.PreprocessorDefinitions = conf.compiler.PreprocessorDefinitions; + foreach (const ProString &path, project->values("RC_INCLUDEPATH")) { + QString fixedPath = fileFixify(path.toQString()); + if (fileInfo(fixedPath).isRelative()) { + if (fixedPath == QStringLiteral(".")) + fixedPath = QStringLiteral("$(ProjectDir)"); + else + fixedPath.prepend(QStringLiteral("$(ProjectDir)\\")); + } + conf.resource.AdditionalIncludeDirectories << escapeFilePath(fixedPath); + } + // We need to add _DEBUG for the debug version of the project, since the normal compiler defines // do not contain it. (The compiler defines this symbol automatically, which is wy we don't need // to add it for the compiler) However, the resource tool does not do this. diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 2fb1fb952b..bda035e023 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -453,6 +453,7 @@ void Win32MakefileGenerator::processRcFileVar() ts << "\t\t\t\tVALUE \"LegalCopyright\", \"" << copyright << "\\0\"" << endl; ts << "\t\t\t\tVALUE \"OriginalFilename\", \"" << originalName << "\\0\"" << endl; ts << "\t\t\t\tVALUE \"ProductName\", \"" << productName << "\\0\"" << endl; + ts << "\t\t\t\tVALUE \"ProductVersion\", \"" << versionString << "\\0\"" << endl; ts << "\t\t\tEND" << endl; ts << "\t\tEND" << endl; ts << "\t\tBLOCK \"VarFileInfo\"" << endl; @@ -461,10 +462,6 @@ void Win32MakefileGenerator::processRcFileVar() << QString("0x%1").arg(rcLang, 4, 16, QLatin1Char('0')) << ", " << QString("%1").arg(rcCodePage, 4) << endl; ts << "\t\tEND" << endl; - ts << "\t\tBLOCK \"VarFileInfo\"" << endl; - ts << "\t\tBEGIN" << endl; - ts << "\t\t\tVALUE \"Translation\", 0x409, 1200" << endl; - ts << "\t\tEND" << endl; ts << "\tEND" << endl; ts << "/* End of Version info */" << endl; ts << endl; @@ -744,7 +741,7 @@ void Win32MakefileGenerator::writeLibsPart(QTextStream &t) t << "LIBAPP = " << var("QMAKE_LIB") << endl; t << "LIBFLAGS = " << var("QMAKE_LIBFLAGS") << endl; } else { - t << "LINK = " << var("QMAKE_LINK") << endl; + t << "LINKER = " << var("QMAKE_LINK") << endl; t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; t << "LIBS = " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl; } @@ -782,8 +779,20 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t) // use these defines in the .rc file itself. Also, we need to add the _DEBUG define manually // since the compiler defines this symbol by itself, and we use it in the automatically // created rc file when VERSION is define the .pro file. + + const ProStringList rcIncPaths = project->values("RC_INCLUDEPATH"); + QString incPathStr; + for (int i = 0; i < rcIncPaths.count(); ++i) { + const ProString &path = rcIncPaths.at(i); + if (path.isEmpty()) + continue; + incPathStr += QStringLiteral(" /i "); + incPathStr += escapeFilePath(path); + } + t << res_file << ": " << rc_file << "\n\t" - << var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "") << " $(DEFINES) -fo " << res_file << " " << rc_file; + << var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "") + << " $(DEFINES)" << incPathStr << " -fo " << res_file << " " << rc_file; t << endl << endl; } } |