From b576f53bf30188a0fa97a6c9a8dc5c3f92c20678 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Mon, 14 Mar 2022 11:38:21 +0100 Subject: Fix compile before Qt5.15 Change-Id: I6c8d265adf8e8b15c0a615a0f52ecc889ff862d3 Reviewed-by: Denis Shienkov --- src/app/qbs-setup-toolchains/dmcprobe.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/qbs-setup-toolchains/dmcprobe.cpp b/src/app/qbs-setup-toolchains/dmcprobe.cpp index 3cb84490b..d542f9bcd 100644 --- a/src/app/qbs-setup-toolchains/dmcprobe.cpp +++ b/src/app/qbs-setup-toolchains/dmcprobe.cpp @@ -208,7 +208,7 @@ static Version dumpDmcVersion(const QFileInfo &compiler) for (const auto ¯o : macros) { if (!macro.startsWith(QLatin1String("0x"))) continue; - const int verCode = QStringView{macro}.mid(2).toInt(); + const int verCode = macro.mid(2).toInt(); return Version{(verCode / 100), (verCode % 100), 0}; } qbsWarning() << Tr::tr("No __DMC__ token was found in the compiler dump"); -- cgit v1.2.3 From e6d0980e47601dbb80f40672781a2940c566fb77 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 24 Mar 2022 12:40:59 +0200 Subject: Fix/suppress compiler warnings with Qt6/MSVC Change-Id: Ic3a13c71a841a3e6c31a2c6d06c79836a54318fb Reviewed-by: Christian Kandeler --- src/lib/corelib/tools/stlutils.h | 2 +- src/lib/corelib/tools/vsenvironmentdetector.cpp | 2 +- src/lib/scriptengine/CMakeLists.txt | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/corelib/tools/stlutils.h b/src/lib/corelib/tools/stlutils.h index 104f88aaf..70e3f2b6d 100644 --- a/src/lib/corelib/tools/stlutils.h +++ b/src/lib/corelib/tools/stlutils.h @@ -58,7 +58,7 @@ template To transformed(const From &from, Op op) { To to; - to.reserve(from.size()); + to.reserve(int(from.size())); std::transform(std::cbegin(from), std::cend(from), std::back_inserter(to), std::move(op)); return to; } diff --git a/src/lib/corelib/tools/vsenvironmentdetector.cpp b/src/lib/corelib/tools/vsenvironmentdetector.cpp index 06c34a79d..5bcbd93b6 100644 --- a/src/lib/corelib/tools/vsenvironmentdetector.cpp +++ b/src/lib/corelib/tools/vsenvironmentdetector.cpp @@ -64,7 +64,7 @@ static QString windowsSystem32Path() #ifdef Q_OS_WIN wchar_t str[UNICODE_STRING_MAX_CHARS]; if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_SYSTEM, NULL, 0, str))) - return QString::fromUtf16(reinterpret_cast(str)); + return QString::fromUtf16(reinterpret_cast(str)); #endif return {}; } diff --git a/src/lib/scriptengine/CMakeLists.txt b/src/lib/scriptengine/CMakeLists.txt index 0533cfac5..deb9b0f8d 100644 --- a/src/lib/scriptengine/CMakeLists.txt +++ b/src/lib/scriptengine/CMakeLists.txt @@ -73,7 +73,8 @@ elseif(WIN32) endif() if (MSVC) - set(QT_SCRIPT_CXX_FLAGS "/wd4291" "/wd4344" "/wd4396" "/wd4503" "/wd4800" "/wd4819" "/wd4996") + set(QT_SCRIPT_CXX_FLAGS "/wd4146" "/wd4244" "/wd4267" "/wd4291" "/wd4334" + "/wd4344" "/wd4396" "/wd4503" "/wd4800" "/wd4819" "/wd4996") else() set(QT_SCRIPT_CXX_FLAGS "-fno-strict-aliasing" "-w" "-Wall" "-Wreturn-type" "-Wcast-align" "-Wchar-subscripts" -- cgit v1.2.3 From ea199ebaa096913fd456f6ec1d433be904b85dbd Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 22 Mar 2022 14:14:39 +0100 Subject: Qt support: Fix static builds against Qt 6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Qt 6 prl files can contain object files these days, which we must de- duplicate manually when gathering plugin libraries. Task-number: QBS-1692 Change-Id: I479cf759b53bde0908f150de86405a810f5b2dea Reviewed-by: Jörg Bornemann --- share/qbs/module-providers/Qt/templates/qml.js | 6 +++--- share/qbs/module-providers/Qt/templates/qml.qbs | 12 +++++++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/share/qbs/module-providers/Qt/templates/qml.js b/share/qbs/module-providers/Qt/templates/qml.js index ea8293f2d..a159aa907 100644 --- a/share/qbs/module-providers/Qt/templates/qml.js +++ b/share/qbs/module-providers/Qt/templates/qml.js @@ -59,7 +59,7 @@ function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDi var prlFile = new TextFile(prlFilePath, TextFile.ReadOnly); try { var pluginLib; - var otherLibs = ""; + var otherLibs = []; var line; while (!prlFile.atEof()) { line = prlFile.readLine().trim(); @@ -74,12 +74,12 @@ function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDi otherLibsLine = otherLibsLine.replace(/-l([^ ]+)/g, "$1" + ".lib"); } otherLibsLine = otherLibsLine.replace(/\$\$\[QT_INSTALL_LIBS\]/g, qtLibDir); - otherLibs += otherLibsLine + '\n'; + otherLibs = otherLibs.concat(otherLibsLine.split(' ')); } } if (!pluginLib) throw "Malformed prl file '" + prlFilePath + "'."; - return pluginLib + ' ' + otherLibs; + return [pluginLib].concat(otherLibs); } finally { prlFile.close(); } diff --git a/share/qbs/module-providers/Qt/templates/qml.qbs b/share/qbs/module-providers/Qt/templates/qml.qbs index 23cb60426..88e973141 100644 --- a/share/qbs/module-providers/Qt/templates/qml.qbs +++ b/share/qbs/module-providers/Qt/templates/qml.qbs @@ -1,3 +1,4 @@ +import qbs.FileInfo import qbs.Host import qbs.TextFile import '../QtModule.qbs' as QtModule @@ -156,6 +157,7 @@ QtModule { if (cppFile) cppFile.writeLine("#include "); var plugins = { }; + var libsWithUniqueObjects = []; for (var p in scannerData) { var plugin = scannerData[p].plugin; if (!plugin || plugins[plugin]) @@ -173,8 +175,16 @@ QtModule { product.qbs.targetOS, product.qbs.toolchain, product.Qt.core.libPath); - listFile.write(libs + ' '); + for (var i = 0; i < libs.length; ++i) { + var lib = libs[i]; + if (!lib.endsWith(product.cpp.objectSuffix) + || (!libsWithUniqueObjects.contains(lib) + && !product.cpp.staticLibraries.contains(FileInfo.cleanPath(lib)))) { + libsWithUniqueObjects.push(lib); + } + } } + listFile.write(libsWithUniqueObjects.join("\n")); } finally { if (cppFile) cppFile.close(); -- cgit v1.2.3 From 6c57af7269d32663cbdb36c5c8939d928bda983a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 22 Mar 2022 15:58:26 +0100 Subject: Qt support: Consider QT_INSTALL_PREFIX when reading .prl files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... for gathering plugin dependencies with static builds. Task-number: QBS-1692 Change-Id: I57322da56c5145cec0250f204b4b06a3a9140bf6 Reviewed-by: Jörg Bornemann --- share/qbs/module-providers/Qt/setup-qt.js | 1 + share/qbs/module-providers/Qt/templates/core.qbs | 1 + share/qbs/module-providers/Qt/templates/qml.js | 3 ++- share/qbs/module-providers/Qt/templates/qml.qbs | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js index 6dd42312c..c7efef014 100644 --- a/share/qbs/module-providers/Qt/setup-qt.js +++ b/share/qbs/module-providers/Qt/setup-qt.js @@ -1425,6 +1425,7 @@ function replaceSpecialValues(content, module, qtProps, abi) { qtConfig: ModUtils.toJSLiteral(qtProps.qtConfigItems), binPath: ModUtils.toJSLiteral(qtProps.binaryPath), installPath: ModUtils.toJSLiteral(qtProps.installPath), + installPrefixPath: ModUtils.toJSLiteral(qtProps.installPrefixPath), libPath: ModUtils.toJSLiteral(qtProps.libraryPath), libExecPath: ModUtils.toJSLiteral(qtProps.libExecPath), qmlLibExecPath: ModUtils.toJSLiteral(qtProps.qmlLibExecPath), diff --git a/share/qbs/module-providers/Qt/templates/core.qbs b/share/qbs/module-providers/Qt/templates/core.qbs index 18ad5a2ab..fd81930ba 100644 --- a/share/qbs/module-providers/Qt/templates/core.qbs +++ b/share/qbs/module-providers/Qt/templates/core.qbs @@ -43,6 +43,7 @@ Module { property path installPath: @installPath@ property path incPath: @incPath@ property path libPath: @libPath@ + property path installPrefixPath: @installPrefixPath@ property path libExecPath: @libExecPath@ property path qmlLibExecPath: @qmlLibExecPath@ property path pluginPath: @pluginPath@ diff --git a/share/qbs/module-providers/Qt/templates/qml.js b/share/qbs/module-providers/Qt/templates/qml.js index a159aa907..36f60f8a3 100644 --- a/share/qbs/module-providers/Qt/templates/qml.js +++ b/share/qbs/module-providers/Qt/templates/qml.js @@ -39,7 +39,7 @@ function getPrlRhs(line) return line.split('=')[1].trim(); } -function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDir) +function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDir, qtDir) { if (!pluginData.path) return ""; @@ -74,6 +74,7 @@ function getLibsForPlugin(pluginData, buildVariant, targetOS, toolchain, qtLibDi otherLibsLine = otherLibsLine.replace(/-l([^ ]+)/g, "$1" + ".lib"); } otherLibsLine = otherLibsLine.replace(/\$\$\[QT_INSTALL_LIBS\]/g, qtLibDir); + otherLibsLine = otherLibsLine.replace(/\$\$\[QT_INSTALL_PREFIX\]/g, qtDir); otherLibs = otherLibs.concat(otherLibsLine.split(' ')); } } diff --git a/share/qbs/module-providers/Qt/templates/qml.qbs b/share/qbs/module-providers/Qt/templates/qml.qbs index 88e973141..747558f10 100644 --- a/share/qbs/module-providers/Qt/templates/qml.qbs +++ b/share/qbs/module-providers/Qt/templates/qml.qbs @@ -174,7 +174,8 @@ QtModule { product.Qt.core.qtBuildVariant, product.qbs.targetOS, product.qbs.toolchain, - product.Qt.core.libPath); + product.Qt.core.libPath, + product.Qt.core.installPrefixPath); for (var i = 0; i < libs.length; ++i) { var lib = libs[i]; if (!lib.endsWith(product.cpp.objectSuffix) -- cgit v1.2.3 From e01a68e82e89cefab8e3b1f5bd8efee1a92463f5 Mon Sep 17 00:00:00 2001 From: Ivan Komissarov Date: Mon, 28 Mar 2022 19:46:49 +0300 Subject: Fix building release packages Change-Id: Ic3957b7dbaf449bb52af117d8a84fc3752a9309f Reviewed-by: Christian Kandeler --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb1c63ef1..7c3396a1d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -121,7 +121,7 @@ jobs: build-windows-with-docker: name: Build on Windows (Docker) - runs-on: windows-latest + runs-on: windows-2019 timeout-minutes: 60 env: WITH_TESTS: 0 -- cgit v1.2.3 From 7259f0db9ca51947630abfc2f813d16e9f4a8945 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 28 Mar 2022 16:33:49 +0200 Subject: Qt support: Fix wrong lib file path deduction for "external" modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The list of libraries can contain names (e.g. "m" or "z") rather than file paths, in which case we must not use it to guess the module's library file. Amends c82daaac43. Change-Id: I10fd6e1fcc8268adbc595345af80955be0dba5ec Reviewed-by: Raphaël Cotty Reviewed-by: Jörg Bornemann --- share/qbs/module-providers/Qt/setup-qt.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js index c7efef014..72b21c395 100644 --- a/share/qbs/module-providers/Qt/setup-qt.js +++ b/share/qbs/module-providers/Qt/setup-qt.js @@ -792,12 +792,12 @@ function doSetupLibraries(modInfo, qtProps, debugBuild, nonExistingPrlFiles, and } catch (e) { // qt_ext_lib_extX.pri (usually) don't have a corresponding prl file. // So the pri file variable QMAKE_LIBS_LIBX points to the library - if (modInfo.isExternal ) { + if (modInfo.isExternal) { libFilePath = debugBuild ? modInfo.staticLibrariesDebug[0] : modInfo.staticLibrariesRelease[0]; - } else { - libFilePath = guessLibraryFilePath(prlFilePath, libDir, qtProps); } + if (!libFilePath || !File.exists(libFilePath)) + libFilePath = guessLibraryFilePath(prlFilePath, libDir, qtProps); if (nonExistingPrlFiles.contains(prlFilePath)) return; nonExistingPrlFiles.push(prlFilePath); -- cgit v1.2.3 From 77ce522281f33a6d06e7cd9fde39e9f578134533 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 28 Mar 2022 15:57:58 +0200 Subject: Bump version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iecc83aa9f30486068f01db16e35aaff890faa225 Reviewed-by: Jörg Bornemann --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 57807d6d0..6245beecd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.22.0 +1.22.1 -- cgit v1.2.3 From d64c7802fef2872aa6a78c06648a0aed45250955 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 30 Mar 2022 12:10:38 +0200 Subject: Fix Xcode support for 13.3 Some .xcspec files got new names and/or locations. Also, we now fully expand the values of property list variables before applying formatters. Presumably this used to work by accident because a simple look-up never produced a value in need of expansion. Fixes: QBS-1693 Change-Id: Ie66ec69042cdceede9d5ddec7c17de1c3c25a167 Reviewed-by: Ivan Komissarov --- share/qbs/imports/qbs/DarwinTools/darwin-tools.js | 72 ++++++++++++----------- share/qbs/imports/qbs/Probes/XcodeProbe.qbs | 2 +- share/qbs/modules/bundle/bundle.js | 6 +- share/qbs/modules/xcode/xcode.js | 14 ++++- 4 files changed, 55 insertions(+), 39 deletions(-) diff --git a/share/qbs/imports/qbs/DarwinTools/darwin-tools.js b/share/qbs/imports/qbs/DarwinTools/darwin-tools.js index f88f6ff52..15f2c54ec 100644 --- a/share/qbs/imports/qbs/DarwinTools/darwin-tools.js +++ b/share/qbs/imports/qbs/DarwinTools/darwin-tools.js @@ -182,6 +182,41 @@ var PropertyListVariableExpander = (function () { return { "syntax": syntax, "index": idx }; } + function expandString(key, str, env) { + if (!str) + return str; + var repl = indexOfReplacementStart(syntaxes, str); + var i = repl.index; + while (i !== -1) { + var j = str.indexOf(repl.syntax.close, i + repl.syntax.open.length); + if (j === -1) + return str; + var varParts = str.slice(i + repl.syntax.open.length, j).split(':'); + var varName = varParts[0]; + var varFormatter = varParts[1]; + var varValue = expandString(key, env[varName], env); + if (undefined === varValue) { + // skip replacement + if ($this.undefinedVariableFunction) + $this.undefinedVariableFunction(key, varName); + varValue = ""; + } + varValue = String(varValue); + if (varFormatter !== undefined) { + // TODO: XCode supports multiple formatters separated by a comma + var varFormatterLower = varFormatter.toLowerCase(); + if (varFormatterLower === "rfc1034identifier" || varFormatterLower === "identifier") + varValue = Utilities.rfc1034Identifier(varValue); + if (varValue === "" && varFormatterLower.startsWith("default=")) + varValue = varFormatter.split("=")[1]; + } + str = str.slice(0, i) + varValue + str.slice(j + repl.syntax.close.length); + repl = indexOfReplacementStart(syntaxes, str); + i = repl.index; + } + return str; + } + function expandRecursive(obj, env, checked) { checked.push(obj); for (var key in obj) { @@ -194,40 +229,9 @@ var PropertyListVariableExpander = (function () { } if (type !== "string") continue; - var repl = indexOfReplacementStart(syntaxes, value); - var i = repl.index; - var changes = false; - while (i !== -1) { - var j = value.indexOf(repl.syntax.close, i + repl.syntax.open.length); - if (j === -1) - break; - var varParts = value.slice(i + repl.syntax.open.length, j).split(':'); - var varName = varParts[0]; - var varFormatter = varParts[1]; - var varValue = env[varName]; - if (undefined === varValue) { - // skip replacement - if ($this.undefinedVariableFunction) - $this.undefinedVariableFunction(key, varName); - varValue = ""; - } - varValue = String(varValue); - if (varFormatter !== undefined) { - // TODO: XCode supports multiple formatters separated by a comma - var varFormatterLower = varFormatter.toLowerCase(); - if (varFormatterLower === "rfc1034identifier") - varValue = Utilities.rfc1034Identifier(varValue); - if (varValue === "" && varFormatterLower.startsWith("default=")) - varValue = varFormatter.split("=")[1]; - } - - value = value.slice(0, i) + varValue + value.slice(j + repl.syntax.close.length); - changes = true; - repl = indexOfReplacementStart(syntaxes, value); - i = repl.index; - } - if (changes) - obj[key] = value; + var expandedValue = expandString(key, value, env); + if (expandedValue !== value) + obj[key] = expandedValue; } } expandRecursive(obj, env, []); diff --git a/share/qbs/imports/qbs/Probes/XcodeProbe.qbs b/share/qbs/imports/qbs/Probes/XcodeProbe.qbs index edd67433b..9a0d01072 100644 --- a/share/qbs/imports/qbs/Probes/XcodeProbe.qbs +++ b/share/qbs/imports/qbs/Probes/XcodeProbe.qbs @@ -89,7 +89,7 @@ Probe { architectureSettings = {}; var archSpecsPath = Xcode.archsSpecsPath(xcodeVersion, targetOS, platformType, - platformPath, devicePlatformPath); + platformPath, devicePlatformPath, developerPath); var archSpecsReader = new Xcode.XcodeArchSpecsReader(archSpecsPath); archSpecsReader.getArchitectureSettings().map(function (setting) { var val = archSpecsReader.getArchitectureSettingValue(setting); diff --git a/share/qbs/modules/bundle/bundle.js b/share/qbs/modules/bundle/bundle.js index 293f53225..7fb89974a 100644 --- a/share/qbs/modules/bundle/bundle.js +++ b/share/qbs/modules/bundle/bundle.js @@ -181,15 +181,15 @@ var XcodeBuildSpecsReader = (function () { var i, j; for (i = 0; i < specsPaths.length; ++i) { var specsPath = specsPaths[i]; - var names = ["Darwin", "MacOSX"]; + var names = ["", "Darwin", "MacOSX"]; for (j = 0; j < names.length; ++j) { var name = names[j]; var plist = new PropertyList2(); var plist2 = new PropertyList2(); try { - var plistName = [name, "Package", "Types.xcspec"].join(separator); - var plistName2 = [name, "Product", "Types.xcspec"].join(separator); + var plistName = [name, "Package", "Types.xcspec"].join(name ? separator : ""); + var plistName2 = [name, "Product", "Types.xcspec"].join(name ? separator : ""); var plistPath = FileInfo.joinPaths(specsPath, plistName); var plistPath2 = FileInfo.joinPaths(specsPath, plistName2); if (File.exists(plistPath)) { diff --git a/share/qbs/modules/xcode/xcode.js b/share/qbs/modules/xcode/xcode.js index 1060894d4..c6c77ca73 100644 --- a/share/qbs/modules/xcode/xcode.js +++ b/share/qbs/modules/xcode/xcode.js @@ -202,7 +202,19 @@ function boolFromSdkOrPlatform(varName, sdkProps, platformProps, defaultValue) { return defaultValue; } -function archsSpecsPath(version, targetOS, platformType, platformPath, devicePlatformPath) { +function archsSpecsPath(version, targetOS, platformType, platformPath, devicePlatformPath, + developerPath) { + if (Utilities.versionCompare(version, "13.3") >= 0) { + var baseDir = FileInfo.joinPaths(developerPath, "..", + "PlugIns/XCBSpecifications.ideplugin/Contents/Resources"); + var baseName = targetOS.contains("macos") ? "MacOSX Architectures" + : targetOS.contains("ios-simulator") ? "iOS Simulator" + : targetOS.contains("ios") ? "iOS Device" + : targetOS.contains("tvos-simulator") ? "tvOS Simulator" + : targetOS.contains("tvos") ? "tvOS Device" + : targetOS.contains("watchos-simulator") ? "watchOS Simulator" : "watchOS Device"; + return FileInfo.joinPaths(baseDir, baseName + ".xcspec"); + } var _specsPluginBaseName; if (Utilities.versionCompare(version, "12") >= 0) { if (targetOS.contains("macos")) -- cgit v1.2.3 From 66c67898456c4f599e48d5466022d49b044f679d Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 1 Apr 2022 13:15:42 +0200 Subject: Add changelog for 1.22.1 Change-Id: Ided671e2255315dba2bdbc0491eed3689cd36d53 Reviewed-by: Christian Kandeler --- changelogs/changes-1.22.1.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 changelogs/changes-1.22.1.md diff --git a/changelogs/changes-1.22.1.md b/changelogs/changes-1.22.1.md new file mode 100644 index 000000000..2dce55bad --- /dev/null +++ b/changelogs/changes-1.22.1.md @@ -0,0 +1,7 @@ +# General + +* Adapted to changes in Xcode 13.3 (QBS-1693) + +# Qt Support + +* Fixed building against static Qt 6 (QBS-1692) -- cgit v1.2.3