diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2022-04-04 11:18:32 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2022-04-04 11:24:27 +0200 |
commit | f0800b40df8ee152d522a1cd40b7ad1a8cf03f4b (patch) | |
tree | 3140f8553dbee32a04a8d4f72e39b17afc7de6bb | |
parent | b72ae2d75c2f4cda5ca47bfa088fadbb63fa62dd (diff) | |
parent | 66c67898456c4f599e48d5466022d49b044f679d (diff) |
Merge 1.22 into master
Change-Id: I2181ed85563337acab8ec4b563b45511be16f21f
-rw-r--r-- | .github/workflows/release.yml | 2 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | changelogs/changes-1.22.1.md | 7 | ||||
-rw-r--r-- | share/qbs/imports/qbs/DarwinTools/darwin-tools.js | 72 | ||||
-rw-r--r-- | share/qbs/imports/qbs/Probes/XcodeProbe.qbs | 2 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/setup-qt.js | 7 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/templates/core.qbs | 1 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/templates/qml.js | 9 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/templates/qml.qbs | 15 | ||||
-rw-r--r-- | share/qbs/modules/bundle/bundle.js | 6 | ||||
-rw-r--r-- | share/qbs/modules/xcode/xcode.js | 14 | ||||
-rw-r--r-- | src/app/qbs-setup-toolchains/dmcprobe.cpp | 2 | ||||
-rw-r--r-- | src/lib/corelib/tools/stlutils.h | 2 | ||||
-rw-r--r-- | src/lib/corelib/tools/vsenvironmentdetector.cpp | 2 | ||||
-rw-r--r-- | src/lib/scriptengine/CMakeLists.txt | 3 |
15 files changed, 92 insertions, 54 deletions
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 @@ -1 +1 @@ -1.22.0 +1.23.0 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) 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/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js index 6dd42312c..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); @@ -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 ea8293f2d..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 ""; @@ -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,13 @@ 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'; + otherLibsLine = otherLibsLine.replace(/\$\$\[QT_INSTALL_PREFIX\]/g, qtDir); + 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..747558f10 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 <QtPlugin>"); var plugins = { }; + var libsWithUniqueObjects = []; for (var p in scannerData) { var plugin = scannerData[p].plugin; if (!plugin || plugins[plugin]) @@ -172,9 +174,18 @@ QtModule { product.Qt.core.qtBuildVariant, product.qbs.targetOS, product.qbs.toolchain, - product.Qt.core.libPath); - listFile.write(libs + ' '); + 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) + || (!libsWithUniqueObjects.contains(lib) + && !product.cpp.staticLibraries.contains(FileInfo.cleanPath(lib)))) { + libsWithUniqueObjects.push(lib); + } + } } + listFile.write(libsWithUniqueObjects.join("\n")); } finally { if (cppFile) cppFile.close(); 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")) 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"); 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 <typename To, typename From, typename Op> 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<ushort*>(str)); + return QString::fromUtf16(reinterpret_cast<char16_t*>(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" |