From c0c75b3c2093976bab90dbf1566a02a1d10f2d33 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 28 Oct 2016 15:12:51 +0200 Subject: vcxproj generator: Support the /DEBUG:FASTLINK option of VS 2015 Make qmake understand the /DEBUG:FASTLINK option in QMAKE_LFLAGS, and write the corresponding value correctly to VS 2015 project files. Task-number: QTBUG-55591 Change-Id: I670375ed1523a5ab96bb3cce28635785564edba8 Reviewed-by: Oswald Buddenhagen Reviewed-by: Friedemann Kleint Reviewed-by: Joerg Bornemann --- qmake/generators/win32/msbuild_objectmodel.cpp | 17 ++++++++++++++++- qmake/generators/win32/msvc_objectmodel.cpp | 4 +++- qmake/generators/win32/msvc_objectmodel.h | 5 +++++ 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'qmake') diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 9dbb33ba14..fec181e61f 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -1163,6 +1163,21 @@ static inline QString toString(subSystemOption option) return QString(); } +static inline QString toString(triState genDebugInfo, linkerDebugOption option) +{ + switch (genDebugInfo) { + case unset: + break; + case _False: + return "false"; + case _True: + if (option == linkerDebugOptionFastLink) + return "DebugFastLink"; + return "true"; + } + return QString(); +} + static inline QString toString(machineTypeOption option) { switch (option) { @@ -1541,7 +1556,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCLinkerTool &tool) << attrTagS(_EntryPointSymbol, tool.EntryPointSymbol) << attrTagX(_ForceSymbolReferences, tool.ForceSymbolReferences, ";") << attrTagS(_FunctionOrder, tool.FunctionOrder) - << attrTagT(_GenerateDebugInformation, tool.GenerateDebugInformation) + << attrTagS(_GenerateDebugInformation, toString(tool.GenerateDebugInformation, tool.DebugInfoOption)) << attrTagT(_GenerateManifest, tool.GenerateManifest) << attrTagT(_GenerateWindowsMetadata, tool.GenerateWindowsMetadata) << attrTagS(_WindowsMetadataFile, tool.GenerateWindowsMetadata == _True ? tool.WindowsMetadataFile : QString()) diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 7fd748e39c..82adc6814c 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -1430,8 +1430,10 @@ bool VCLinkerTool::parseOption(const char* option) }else EnableUAC = _True; break; - case 0x3389797: // /DEBUG + case 0x3389797: // /DEBUG[:FASTLINK] GenerateDebugInformation = _True; + if (config->CompilerVersion >= NET2015 && strcmp(option + 7, "FASTLINK") == 0) + DebugInfoOption = linkerDebugOptionFastLink; break; case 0x0033896: // /DEF:filename ModuleDefinitionFile = option+5; diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 7092da3e59..96923ba23d 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -282,6 +282,10 @@ enum inlineExpansionOption { expandAnySuitable, expandDefault // Not useful number, but stops the output }; +enum linkerDebugOption { + linkerDebugOptionNone, + linkerDebugOptionFastLink +}; enum linkIncrementalType { linkIncrementalDefault, linkIncrementalNo, @@ -595,6 +599,7 @@ public: QStringList ForceSymbolReferences; QString FunctionOrder; triState GenerateDebugInformation; + linkerDebugOption DebugInfoOption; triState GenerateMapFile; qlonglong HeapCommitSize; qlonglong HeapReserveSize; -- cgit v1.2.3 From 8db556d29919fd0c0ddb23b743cb5e6c218b1ae2 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 9 Nov 2016 13:11:31 +0100 Subject: fix $$section()'s bad argument count error message the autotest was also broken, because it was created by pasting the bogus message into the result ... Change-Id: I02b8663b96c7d96cdb3c19639e2213e49fd2bcec Reviewed-by: Joerg Bornemann --- qmake/library/qmakebuiltins.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'qmake') diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index 8f3849e6d8..c8208909b6 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -478,8 +478,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( int end = -1; if (func_t == E_SECTION) { if (args.count() != 3 && args.count() != 4) { - evalError(fL1S("%1(var) section(var, sep, begin, end) requires" - " three or four arguments.").arg(func.toQString(m_tmp1))); + evalError(fL1S("section(var, sep, begin, end) requires three or four arguments.")); } else { var = args[0]; sep = args.at(1).toQString(); -- cgit v1.2.3 From 9308b7d618db7f08768b11c17b661853c66005e4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 8 Nov 2016 13:41:27 +0100 Subject: don't create bogus property variants sysroot, spec, and xspec have no /src and /get variants. Change-Id: I8548791f8ea6ba9fd9f10c35f914ed6badbea9d4 Reviewed-by: Joerg Bornemann --- qmake/property.cpp | 53 ++++++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 25 deletions(-) (limited to 'qmake') diff --git a/qmake/property.cpp b/qmake/property.cpp index 817ae953d5..b9139d5be1 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -46,38 +46,41 @@ static const struct { const char *name; QLibraryInfo::LibraryLocation loc; bool raw; + bool singular; } propList[] = { - { "QT_SYSROOT", QLibraryInfo::SysrootPath, true }, - { "QT_INSTALL_PREFIX", QLibraryInfo::PrefixPath, false }, - { "QT_INSTALL_ARCHDATA", QLibraryInfo::ArchDataPath, false }, - { "QT_INSTALL_DATA", QLibraryInfo::DataPath, false }, - { "QT_INSTALL_DOCS", QLibraryInfo::DocumentationPath, false }, - { "QT_INSTALL_HEADERS", QLibraryInfo::HeadersPath, false }, - { "QT_INSTALL_LIBS", QLibraryInfo::LibrariesPath, false }, - { "QT_INSTALL_LIBEXECS", QLibraryInfo::LibraryExecutablesPath, false }, - { "QT_INSTALL_BINS", QLibraryInfo::BinariesPath, false }, - { "QT_INSTALL_TESTS", QLibraryInfo::TestsPath, false }, - { "QT_INSTALL_PLUGINS", QLibraryInfo::PluginsPath, false }, - { "QT_INSTALL_IMPORTS", QLibraryInfo::ImportsPath, false }, - { "QT_INSTALL_QML", QLibraryInfo::Qml2ImportsPath, false }, - { "QT_INSTALL_TRANSLATIONS", QLibraryInfo::TranslationsPath, false }, - { "QT_INSTALL_CONFIGURATION", QLibraryInfo::SettingsPath, false }, - { "QT_INSTALL_EXAMPLES", QLibraryInfo::ExamplesPath, false }, - { "QT_INSTALL_DEMOS", QLibraryInfo::ExamplesPath, false }, // Just backwards compat - { "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true }, - { "QT_HOST_DATA", QLibraryInfo::HostDataPath, true }, - { "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true }, - { "QT_HOST_LIBS", QLibraryInfo::HostLibrariesPath, true }, - { "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true }, - { "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true }, + { "QT_SYSROOT", QLibraryInfo::SysrootPath, true, true }, + { "QT_INSTALL_PREFIX", QLibraryInfo::PrefixPath, false, false }, + { "QT_INSTALL_ARCHDATA", QLibraryInfo::ArchDataPath, false, false }, + { "QT_INSTALL_DATA", QLibraryInfo::DataPath, false, false }, + { "QT_INSTALL_DOCS", QLibraryInfo::DocumentationPath, false, false }, + { "QT_INSTALL_HEADERS", QLibraryInfo::HeadersPath, false, false }, + { "QT_INSTALL_LIBS", QLibraryInfo::LibrariesPath, false, false }, + { "QT_INSTALL_LIBEXECS", QLibraryInfo::LibraryExecutablesPath, false, false }, + { "QT_INSTALL_BINS", QLibraryInfo::BinariesPath, false, false }, + { "QT_INSTALL_TESTS", QLibraryInfo::TestsPath, false, false }, + { "QT_INSTALL_PLUGINS", QLibraryInfo::PluginsPath, false, false }, + { "QT_INSTALL_IMPORTS", QLibraryInfo::ImportsPath, false, false }, + { "QT_INSTALL_QML", QLibraryInfo::Qml2ImportsPath, false, false }, + { "QT_INSTALL_TRANSLATIONS", QLibraryInfo::TranslationsPath, false, false }, + { "QT_INSTALL_CONFIGURATION", QLibraryInfo::SettingsPath, false, false }, + { "QT_INSTALL_EXAMPLES", QLibraryInfo::ExamplesPath, false, false }, + { "QT_INSTALL_DEMOS", QLibraryInfo::ExamplesPath, false, false }, // Just backwards compat + { "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true, false }, + { "QT_HOST_DATA", QLibraryInfo::HostDataPath, true, false }, + { "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true, false }, + { "QT_HOST_LIBS", QLibraryInfo::HostLibrariesPath, true, false }, + { "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true, true }, + { "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true, true }, }; QMakeProperty::QMakeProperty() : settings(0) { for (unsigned i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) { QString name = QString::fromLatin1(propList[i].name); - m_values[ProKey(name + "/src")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectiveSourcePaths); - m_values[ProKey(name + "/get")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths); + if (!propList[i].singular) { + m_values[ProKey(name + "/src")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectiveSourcePaths); + m_values[ProKey(name + "/get")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths); + } QString val = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::FinalPaths); if (!propList[i].raw) { m_values[ProKey(name + "/dev")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::DevicePaths); -- cgit v1.2.3