From c35f610219b1d09f6d05215a2e2fe4f2f6bd966c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 14 Feb 2011 15:57:01 +0100 Subject: qmake vcproj generator: support PCHs with other extensions than .h Task-number: QTBUG-16639 Reviewed-by: Marius Storm-Olsen --- qmake/generators/win32/msvc_objectmodel.cpp | 2 +- qmake/option.h | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 69cfc0d..3253c3b 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2104,7 +2104,7 @@ void VCFilter::modifyPCHstage(QString str) break; } } - bool isHFile = str.endsWith(".h") && (str == Project->precompH); + bool isHFile = Option::hasFileExtension(str, Option::h_ext) && (str == Project->precompH); bool isCPPFile = pchThroughSourceFile && (str == Project->precompCPP); if(!isCFile && !isHFile && !isCPPFile) diff --git a/qmake/option.h b/qmake/option.h index e3ddc9a..bc87343 100644 --- a/qmake/option.h +++ b/qmake/option.h @@ -139,6 +139,14 @@ struct Option return fixString(in, flags); } + inline static bool hasFileExtension(const QString &str, const QStringList &extensions) + { + foreach (const QString &ext, extensions) + if (str.endsWith(ext)) + return true; + return false; + } + //global qmake mode, can only be in one mode per invocation! enum QMAKE_MODE { QMAKE_GENERATE_NOTHING, QMAKE_GENERATE_PROJECT, QMAKE_GENERATE_MAKEFILE, QMAKE_GENERATE_PRL, QMAKE_SET_PROPERTY, QMAKE_QUERY_PROPERTY }; @@ -195,7 +203,6 @@ private: inline QString fixEnvVariables(const QString &x) { return Option::fixString(x, Option::FixEnvVars); } inline QStringList splitPathList(const QString &paths) { return paths.split(Option::dirlist_sep); } - // this is a stripped down version of the one found in QtCore class QLibraryInfo { -- cgit v0.12 From a60bd37c08300201bb2a259f390b92e35808843e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 14 Feb 2011 16:20:23 +0100 Subject: qmake vc(x)proj generator: fix reading of /YX, /Yc, /Yu compiler flags Controlling the PCH settings manually via the MSVC compiler flags was broken. Task-number: QTBUG-15594 Reviewed-by: Marius Storm-Olsen --- qmake/generators/win32/msvc_objectmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 3253c3b..020c3d8 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -857,11 +857,11 @@ bool VCCLCompilerTool::parseOption(const char* option) break; case 'X': UsePrecompiledHeader = pchGenerateAuto; - PrecompiledHeaderFile = option+3; + PrecompiledHeaderThrough = option+3; break; case 'c': UsePrecompiledHeader = pchCreateUsingSpecific; - PrecompiledHeaderFile = option+3; + PrecompiledHeaderThrough = option+3; break; case 'd': case 'l': @@ -869,7 +869,7 @@ bool VCCLCompilerTool::parseOption(const char* option) break; case 'u': UsePrecompiledHeader = pchUseUsingSpecific; - PrecompiledHeaderFile = option+3; + PrecompiledHeaderThrough = option+3; break; default: found = false; break; -- cgit v0.12 From fef94ecbfb1c5b576247f2e203d0dd8c2c8f2ae1 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 14 Feb 2011 17:00:02 +0100 Subject: qmake vc(x)proj generator: set the output directory The configuration property OutDir was always set to ".\\". We're now referencing "$(OutDir)" instead of building the path every time from DESTDIR. Also, VCConfiguration::PrimaryOutput was always empty for VS < 2010 and is now unused. The variable MSVCPROJ_LIBOPTIONS was removed. Task-number: QTBUG-16490 Reviewed-by: Marius Storm-Olsen --- qmake/generators/win32/msvc_vcproj.cpp | 45 ++++++---------------------------- 1 file changed, 8 insertions(+), 37 deletions(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 0df33d0..b2e5959 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -878,22 +878,16 @@ void VcprojGenerator::initConfiguration() break; } + conf.OutputDirectory = project->first("DESTDIR"); + if (conf.OutputDirectory.isEmpty()) + conf.OutputDirectory = ".\\"; + if (!conf.OutputDirectory.endsWith("\\")) + conf.OutputDirectory += '\\'; if (conf.CompilerVersion >= NET2010) { - conf.OutputDirectory = project->first("DESTDIR"); - - if(conf.OutputDirectory.isEmpty()) - conf.OutputDirectory = ".\\"; - - if(!conf.OutputDirectory.endsWith("\\")) - conf.OutputDirectory += '\\'; - // The target name could have been changed. conf.PrimaryOutput = project->first("TARGET"); if ( !conf.PrimaryOutput.isEmpty() && !project->first("TARGET_VERSION_EXT").isEmpty() && project->isActiveConfig("shared")) conf.PrimaryOutput.append(project->first("TARGET_VERSION_EXT")); - } else { - conf.PrimaryOutput = project->first("PrimaryOutput"); - conf.OutputDirectory = "."; } conf.Name = project->values("BUILD_NAME").join(" "); @@ -982,13 +976,7 @@ void VcprojGenerator::initCompilerTool() void VcprojGenerator::initLibrarianTool() { VCConfiguration &conf = vcProject.Configuration; - conf.librarian.OutputFile = project->first("DESTDIR"); - if(conf.librarian.OutputFile.isEmpty()) - conf.librarian.OutputFile = ".\\"; - - if(!conf.librarian.OutputFile.endsWith("\\")) - conf.librarian.OutputFile += '\\'; - + conf.librarian.OutputFile = "$(OutDir)\\"; conf.librarian.OutputFile += project->first("MSVCPROJ_TARGET"); conf.librarian.AdditionalOptions += project->values("QMAKE_LIBFLAGS"); } @@ -1018,24 +1006,7 @@ void VcprojGenerator::initLinkerTool() } } - switch (projectTarget) { - case Application: - conf.linker.OutputFile = project->first("DESTDIR"); - break; - case SharedLib: - conf.linker.parseOptions(project->values("MSVCPROJ_LIBOPTIONS")); - conf.linker.OutputFile = project->first("DESTDIR"); - break; - case StaticLib: //unhandled - added to remove warnings.. - break; - } - - if(conf.linker.OutputFile.isEmpty()) - conf.linker.OutputFile = ".\\"; - - if(!conf.linker.OutputFile.endsWith("\\")) - conf.linker.OutputFile += '\\'; - + conf.linker.OutputFile = "$(OutDir)\\"; conf.linker.OutputFile += project->first("MSVCPROJ_TARGET"); if(project->isActiveConfig("dll")){ @@ -1054,7 +1025,7 @@ void VcprojGenerator::initResourceTool() if(project->isActiveConfig("debug")) conf.resource.PreprocessorDefinitions += "_DEBUG"; if(project->isActiveConfig("staticlib")) - conf.resource.ResourceOutputFileName = project->first("DESTDIR") + "/$(InputName).res"; + conf.resource.ResourceOutputFileName = "$(OutDir)\\$(InputName).res"; } void VcprojGenerator::initIDLTool() -- cgit v0.12 From 613d24096e78f8ef161ee0c63f7fda034534f3cd Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 14 Feb 2011 17:17:16 +0100 Subject: qmake vc(x)proj generator: fix handling of DEFINES from .prl files There was some ancient code putting those defines into MSVCPROJ_DEFINES. This variable was used for the VC6 generator. We just let MakefileGenerator handle the variables of a .prl file now. Task-number: QTBUG-16024 Reviewed-by: Marius Storm-Olsen --- qmake/generators/win32/msvc_vcproj.cpp | 13 ------------- qmake/generators/win32/msvc_vcproj.h | 1 - 2 files changed, 14 deletions(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index b2e5959..f243e86 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1548,19 +1548,6 @@ QString VcprojGenerator::findTemplate(QString file) return ret; } -void VcprojGenerator::processPrlVariable(const QString &var, const QStringList &l) -{ - if(var == "QMAKE_PRL_DEFINES") { - QStringList &out = project->values("MSVCPROJ_DEFINES"); - for(QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) { - if(out.indexOf((*it)) == -1) - out.append((" /D " + *it)); - } - } else { - MakefileGenerator::processPrlVariable(var, l); - } -} - void VcprojGenerator::outputVariables() { #if 0 diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index 656afa9..fdcd73f 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -92,7 +92,6 @@ protected: virtual bool mergeBuildProject(MakefileGenerator *other); virtual bool openOutput(QFile &file, const QString &build) const; - virtual void processPrlVariable(const QString &, const QStringList &); virtual bool findLibraries(); virtual void outputVariables(); QString fixFilename(QString ofile) const; -- cgit v0.12 From 5ccd3443fb4604d67a8f65588cc2e3b61c9e1b5c Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 14 Feb 2011 17:23:50 +0100 Subject: qmake: fix the language settings generated Windows resource files On Windows > XP the version information of for example the Qt DLLs are not visible in the Windows explorer. That's due to missing language information in the version resource. Task-number: QT-4054 Task-number: QTBUG-12249 Reviewed-by: Marius Storm-Olsen --- qmake/generators/win32/winmakefile.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index c85533b..ef234ec 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -456,6 +456,10 @@ void Win32MakefileGenerator::processRcFileVar() ts << "\t\t\t\tVALUE \"ProductName\", \"" << productName << "\\0\"" << endl; ts << "\t\t\tEND" << 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; -- cgit v0.12 From 400f151126e2208882875987943a3c8d919ec7f4 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 14 Feb 2011 18:04:15 +0100 Subject: qmake nmake / mingw32-make generators: fix DEF_FILE for shadow builds Task-number: QTBUG-11643 Reviewed-by: Marius Storm-Olsen --- qmake/generators/win32/mingw_make.cpp | 6 ++++-- qmake/generators/win32/msvc_nmake.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 2639332..462920e 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -302,8 +302,10 @@ void MingwMakefileGenerator::init() project->values("QMAKE_LFLAGS").append(QString("-Wl,--out-implib,") + project->first("MINGW_IMPORT_LIB")); } - if(!project->values("DEF_FILE").isEmpty() && project->values("QMAKE_SYMBIAN_SHLIB").isEmpty()) - project->values("QMAKE_LFLAGS").append(QString("-Wl,") + project->first("DEF_FILE")); + if(!project->values("DEF_FILE").isEmpty() && project->values("QMAKE_SYMBIAN_SHLIB").isEmpty()) { + QString defFileName = fileFixify(project->values("DEF_FILE")).first(); + project->values("QMAKE_LFLAGS").append(QString("-Wl,") + escapeFilePath(defFileName)); + } MakefileGenerator::init(); diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 1b2cd18..c55806d 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -218,8 +218,10 @@ void NmakeMakefileGenerator::init() project->values("QMAKE_LIBS") += escapeFilePaths(project->values("RES_FILE")); } - if(!project->values("DEF_FILE").isEmpty()) - project->values("QMAKE_LFLAGS").append(QString("/DEF:") + escapeFilePath(project->first("DEF_FILE"))); + if (!project->values("DEF_FILE").isEmpty()) { + QString defFileName = fileFixify(project->values("DEF_FILE")).first(); + project->values("QMAKE_LFLAGS").append(QString("/DEF:") + escapeFilePath(defFileName)); + } if(!project->values("VERSION").isEmpty()) { QString version = project->values("VERSION")[0]; -- cgit v0.12 From fcfd06409768916ef10c7048a87b2328ec5d45f7 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 14 Feb 2011 18:33:27 +0100 Subject: qmake/Mac: replace @SHORT_VERSION@ in QMAKE_INFO_PLIST file not only for libs Task-number: QTBUG-7993 Reviewed-by: Marius Storm-Olsen --- qmake/generators/mac/pbuilder_pbx.cpp | 2 ++ qmake/generators/unix/unixmake2.cpp | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 0ec946e..19667cd 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -1272,6 +1272,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) plist_in_text = plist_in_text.replace("@EXECUTABLE@", project->first("QMAKE_ORIG_TARGET")); } else { plist_in_text = plist_in_text.replace("@LIBRARY@", project->first("QMAKE_ORIG_TARGET")); + } + if (!project->values("VERSION").isEmpty()) { plist_in_text = plist_in_text.replace("@SHORT_VERSION@", project->first("VER_MAJ") + "." + project->first("VER_MIN")); } diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 5ea13f4..212f8bd 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -712,11 +712,18 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << info_plist_out << ": " << "\n\t"; if(!destdir.isEmpty()) t << mkdir_p_asstring(destdir) << "\n\t"; + QStringList commonSedArgs; + if (!project->values("VERSION").isEmpty()) + commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" "; + commonSedArgs << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? + QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" "; if(project->first("TEMPLATE") == "app") { QString icon = fileFixify(var("ICON")); t << "@$(DEL_FILE) " << info_plist_out << "\n\t" - << "@sed " - << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" " + << "@sed "; + foreach (const QString &arg, commonSedArgs) + t << arg; + t << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" " << "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" " << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " @@ -732,9 +739,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) } } else { t << "@$(DEL_FILE) " << info_plist_out << "\n\t" - << "@sed " - << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" " - << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" " + << "@sed "; + foreach (const QString &arg, commonSedArgs) + t << arg; + t << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" " << "-e \"s,@TYPEINFO@," << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " -- cgit v0.12 From e22c6eb32c4c4c189ba5c11ce61adc8a59a0847b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 15 Mar 2011 15:53:10 +0100 Subject: qmake vcproj generator: do not insert $(INHERIT) This will remove the warnings about undefined environment variables when building with IncrediBuild. Done-with: Marius Storm-Olsen --- qmake/generators/win32/msvc_objectmodel.cpp | 12 ++++++------ qmake/generators/win32/msvc_objectmodel.h | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 020c3d8..5b62b5e 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -355,7 +355,7 @@ VCCLCompilerTool::VCCLCompilerTool() TreatWChar_tAsBuiltInType(unset), TurnOffAssemblyGeneration(unset), UndefineAllPreprocessorDefinitions(unset), - UsePrecompiledHeader(pchNone), + UsePrecompiledHeader(pchUnset), UseUnicodeForAssemblerListing(unset), WarnAsError(unset), WarningLevel(warningLevel_0), @@ -389,7 +389,7 @@ inline XmlOutput::xml_output xformUsePrecompiledHeaderForNET2005(pchOption whatP if (whatPch == pchGenerateAuto) whatPch = (pchOption)0; if (whatPch == pchUseUsingSpecific) whatPch = (pchOption)2; } - return attrE(_UsePrecompiledHeader, whatPch); + return attrE(_UsePrecompiledHeader, whatPch, /*ifNot*/ pchUnset); } inline XmlOutput::xml_output xformExceptionHandlingNET2005(exceptionHandling eh, DotNET compilerVersion) @@ -2145,9 +2145,9 @@ void VCFilter::modifyPCHstage(QString str) useCompilerTool = true; // Setup PCH options - CompilerTool.UsePrecompiledHeader = (isCFile ? pchNone : pchCreateUsingSpecific); - CompilerTool.PrecompiledHeaderThrough = (isCPPFile ? QString("$(INHERIT)") : QString("$(NOINHERIT)")); - CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); + CompilerTool.UsePrecompiledHeader = (isCFile ? pchNone : pchCreateUsingSpecific); + if (!isCPPFile) + CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); } bool VCFilter::addExtraCompiler(const VCFilterFile &info) @@ -2514,7 +2514,7 @@ void VCProjectWriter::write(XmlOutput &xml, const VCCLCompilerTool &tool) << attrT(_TurnOffAssemblyGeneration, tool.TurnOffAssemblyGeneration) << attrT(_UndefineAllPreprocessorDefinitions, tool.UndefineAllPreprocessorDefinitions) << attrX(_UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions) - << (!tool.PrecompiledHeaderFile.isEmpty() || !tool.PrecompiledHeaderThrough.isEmpty() ? xformUsePrecompiledHeaderForNET2005(tool.UsePrecompiledHeader, tool.config->CompilerVersion) : noxml()) + << xformUsePrecompiledHeaderForNET2005(tool.UsePrecompiledHeader, tool.config->CompilerVersion) << attrT(_WarnAsError, tool.WarnAsError) << attrE(_WarningLevel, tool.WarningLevel, /*ifNot*/ warningLevelUnknown) << attrT(_WholeProgramOptimization, tool.WholeProgramOptimization) diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 5431ce0..3e62fb4 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -366,6 +366,7 @@ enum optLinkTimeCodeGenType { optLTCGUpdate }; enum pchOption { + pchUnset = -1, pchNone, pchCreateUsingSpecific, pchGenerateAuto, -- cgit v0.12 From 29b596c647d2339496458231e8eec6c63ccf4641 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 15 Mar 2011 19:00:00 +0100 Subject: Revert "qmake vcproj generator: do not insert $(INHERIT)" This reverts commit e22c6eb32c4c4c189ba5c11ce61adc8a59a0847b. --- qmake/generators/win32/msvc_objectmodel.cpp | 12 ++++++------ qmake/generators/win32/msvc_objectmodel.h | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 5b62b5e..020c3d8 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -355,7 +355,7 @@ VCCLCompilerTool::VCCLCompilerTool() TreatWChar_tAsBuiltInType(unset), TurnOffAssemblyGeneration(unset), UndefineAllPreprocessorDefinitions(unset), - UsePrecompiledHeader(pchUnset), + UsePrecompiledHeader(pchNone), UseUnicodeForAssemblerListing(unset), WarnAsError(unset), WarningLevel(warningLevel_0), @@ -389,7 +389,7 @@ inline XmlOutput::xml_output xformUsePrecompiledHeaderForNET2005(pchOption whatP if (whatPch == pchGenerateAuto) whatPch = (pchOption)0; if (whatPch == pchUseUsingSpecific) whatPch = (pchOption)2; } - return attrE(_UsePrecompiledHeader, whatPch, /*ifNot*/ pchUnset); + return attrE(_UsePrecompiledHeader, whatPch); } inline XmlOutput::xml_output xformExceptionHandlingNET2005(exceptionHandling eh, DotNET compilerVersion) @@ -2145,9 +2145,9 @@ void VCFilter::modifyPCHstage(QString str) useCompilerTool = true; // Setup PCH options - CompilerTool.UsePrecompiledHeader = (isCFile ? pchNone : pchCreateUsingSpecific); - if (!isCPPFile) - CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); + CompilerTool.UsePrecompiledHeader = (isCFile ? pchNone : pchCreateUsingSpecific); + CompilerTool.PrecompiledHeaderThrough = (isCPPFile ? QString("$(INHERIT)") : QString("$(NOINHERIT)")); + CompilerTool.ForcedIncludeFiles = QStringList("$(NOINHERIT)"); } bool VCFilter::addExtraCompiler(const VCFilterFile &info) @@ -2514,7 +2514,7 @@ void VCProjectWriter::write(XmlOutput &xml, const VCCLCompilerTool &tool) << attrT(_TurnOffAssemblyGeneration, tool.TurnOffAssemblyGeneration) << attrT(_UndefineAllPreprocessorDefinitions, tool.UndefineAllPreprocessorDefinitions) << attrX(_UndefinePreprocessorDefinitions, tool.UndefinePreprocessorDefinitions) - << xformUsePrecompiledHeaderForNET2005(tool.UsePrecompiledHeader, tool.config->CompilerVersion) + << (!tool.PrecompiledHeaderFile.isEmpty() || !tool.PrecompiledHeaderThrough.isEmpty() ? xformUsePrecompiledHeaderForNET2005(tool.UsePrecompiledHeader, tool.config->CompilerVersion) : noxml()) << attrT(_WarnAsError, tool.WarnAsError) << attrE(_WarningLevel, tool.WarningLevel, /*ifNot*/ warningLevelUnknown) << attrT(_WholeProgramOptimization, tool.WholeProgramOptimization) diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 3e62fb4..5431ce0 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -366,7 +366,6 @@ enum optLinkTimeCodeGenType { optLTCGUpdate }; enum pchOption { - pchUnset = -1, pchNone, pchCreateUsingSpecific, pchGenerateAuto, -- cgit v0.12