diff options
author | Ivan Komissarov <abbapoh@gmail.com> | 2020-12-18 01:17:50 +0100 |
---|---|---|
committer | Ivan Komissarov <abbapoh@gmail.com> | 2020-12-18 01:19:13 +0100 |
commit | 0b23c1f139a00643521b35f77acfa333b4073194 (patch) | |
tree | d05c959e57403c0190fad46133784b3e77f89a18 /share | |
parent | d3d49f4167e72f3a91d349b36ce95a415234e9d1 (diff) | |
parent | 9e9caf2268fd75f4bddd74084afcc7ba27fe5d2e (diff) |
Merge branch '1.18'
Change-Id: I37c359289dcd957fbc964a35fab381a047f7d04a
Diffstat (limited to 'share')
-rw-r--r-- | share/CMakeLists.txt | 30 | ||||
-rw-r--r-- | share/qbs/imports/qbs/PathTools/path-tools.js | 2 | ||||
-rw-r--r-- | share/qbs/imports/qbs/base/Library.qbs | 2 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/setup-qt.js | 3 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/templates/android_support.qbs | 34 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/templates/core.qbs | 3 | ||||
-rw-r--r-- | share/qbs/modules/Android/sdk/sdk.qbs | 1 | ||||
-rw-r--r-- | share/qbs/modules/cpp/CppModule.qbs | 1 | ||||
-rw-r--r-- | share/qbs/modules/cpp/android-gcc.qbs | 14 | ||||
-rw-r--r-- | share/qbs/modules/cpp/sdcc.js | 1 | ||||
-rw-r--r-- | share/qbs/modules/ib/ib.js | 2 | ||||
-rw-r--r-- | share/qbs/modules/protobuf/cpp/protobufcpp.qbs | 16 | ||||
-rw-r--r-- | share/qbs/modules/protobuf/nanopb/nanopb.qbs | 32 | ||||
-rw-r--r-- | share/qbs/modules/protobuf/protobuf.js | 7 |
14 files changed, 78 insertions, 70 deletions
diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt index bfc657b6f..f607e0a85 100644 --- a/share/CMakeLists.txt +++ b/share/CMakeLists.txt @@ -32,41 +32,37 @@ install( DESTINATION "${QBS_RESOURCES_INSTALL_DIR}/qbs" ) -if(WIN32) - get_target_property(_QTCORE_LIBRARY Qt5::Core IMPORTED_LOCATION_RELEASE) - if(NOT _QTCORE_LIBRARY) - get_target_property(_QTCORE_LIBRARY Qt5::Core IMPORTED_LOCATION_DEBUG) - endif() - get_filename_component(_QT_LIBRARY_PATH "${_QTCORE_LIBRARY}" DIRECTORY) - get_target_property(_QBS_LIBRARY_PATH qbscore LIBRARY_OUTPUT_DIRECTORY) - set(UPDATE_PATH_COMMAND set "PATH=${_QT_LIBRARY_PATH}\;${_QBS_LIBRARY_PATH}\;%PATH%") -else() - set(UPDATE_PATH_COMMAND "") -endif() - +get_update_path_command(UPDATE_PATH_COMMAND) get_target_property(_QBS_OUTPUT_DIR qbs RUNTIME_OUTPUT_DIRECTORY) add_custom_target( BuildQbsResources ALL COMMAND ${UPDATE_PATH_COMMAND} COMMAND ${_QBS_OUTPUT_DIR}/qbs - build + resolve --settings-dir ${PROJECT_BINARY_DIR}/settings -f ${PROJECT_SOURCE_DIR}/qbs.qbs -d ${PROJECT_BINARY_DIR}/ - -p "qbs resources" + config:resources-build qbs.installPrefix:undefined project.withCode:false project.withDocumentation:false profile:none - DEPENDS qbs copy-runtime-files-qbs + COMMAND ${_QBS_OUTPUT_DIR}/qbs + build + --settings-dir ${PROJECT_BINARY_DIR}/settings + -f ${PROJECT_SOURCE_DIR}/qbs.qbs + -d ${PROJECT_BINARY_DIR}/ + config:resources-build + -p "qbs resources" + DEPENDS qbs copy-runtime-files-qbs qbs_processlauncher ) install( - DIRECTORY ${PROJECT_BINARY_DIR}/default/install-root/share/qbs/qml-type-descriptions + DIRECTORY ${PROJECT_BINARY_DIR}/resources-build/install-root/share/qbs/qml-type-descriptions DESTINATION "${QBS_RESOURCES_INSTALL_DIR}/qbs" ) install( - DIRECTORY ${PROJECT_BINARY_DIR}/default/install-root/share/qbs/qml-type-descriptions + DIRECTORY ${PROJECT_BINARY_DIR}/resources-build/install-root/share/qbs/qml-type-descriptions DESTINATION "${QBS_RESOURCES_INSTALL_DIR}/qbs" ) diff --git a/share/qbs/imports/qbs/PathTools/path-tools.js b/share/qbs/imports/qbs/PathTools/path-tools.js index b2cb63e39..a857a7139 100644 --- a/share/qbs/imports/qbs/PathTools/path-tools.js +++ b/share/qbs/imports/qbs/PathTools/path-tools.js @@ -107,6 +107,8 @@ function dynamicLibraryFilePath(product, variantSuffix, version, maxParts) { version = undefined; } + fileName += product.moduleProperty("cpp", "archSuffix"); + // Append the suffix (i.e. libqbs.1.0.0.dylib, libqbs.so, qbs.dll) fileName += product.moduleProperty("cpp", "dynamicLibrarySuffix"); diff --git a/share/qbs/imports/qbs/base/Library.qbs b/share/qbs/imports/qbs/base/Library.qbs index 62e5f9d30..c8a114624 100644 --- a/share/qbs/imports/qbs/base/Library.qbs +++ b/share/qbs/imports/qbs/base/Library.qbs @@ -60,6 +60,8 @@ NativeBinary { return ["dynamiclibrary", "dynamiclibrary_symlink"]; if (isStaticLibrary) return ["staticlibrary"]; + if (isLoadableModule) + return ["loadablemodule"]; return []; } qbs.install: true diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js index a50770b18..a67f79d89 100644 --- a/share/qbs/module-providers/Qt/setup-qt.js +++ b/share/qbs/module-providers/Qt/setup-qt.js @@ -246,7 +246,8 @@ function getQtProperties(qmakeFilePath, qbs) { qtProps.includePath = pathQueryValue(queryResult, "QT_INSTALL_HEADERS"); qtProps.libraryPath = pathQueryValue(queryResult, "QT_INSTALL_LIBS"); qtProps.hostLibraryPath = pathQueryValue(queryResult, "QT_HOST_LIBS"); - qtProps.binaryPath = pathQueryValue(queryResult, "QT_HOST_BINS"); + qtProps.binaryPath = pathQueryValue(queryResult, "QT_HOST_BINS") + || pathQueryValue(queryResult, "QT_INSTALL_BINS"); qtProps.installPath = pathQueryValue(queryResult, "QT_INSTALL_BINS"); qtProps.documentationPath = pathQueryValue(queryResult, "QT_INSTALL_DOCS"); qtProps.pluginPath = pathQueryValue(queryResult, "QT_INSTALL_PLUGINS"); diff --git a/share/qbs/module-providers/Qt/templates/android_support.qbs b/share/qbs/module-providers/Qt/templates/android_support.qbs index bdbb0e43b..3790037f3 100644 --- a/share/qbs/module-providers/Qt/templates/android_support.qbs +++ b/share/qbs/module-providers/Qt/templates/android_support.qbs @@ -68,7 +68,6 @@ Module { } Properties { condition: _enableSdkSupport - Android.sdk._archInName: _multiAbi Android.sdk._bundledInAssets: _multiAbi } Properties { @@ -79,6 +78,7 @@ Module { condition: _enableSdkSupport && Utilities.versionCompare(version, "6.0") >= 0 Android.sdk.minimumVersion: "23" } + cpp.archSuffix: _multiAbi ? "_" + Android.ndk.abi : "" Rule { condition: _enableSdkSupport @@ -324,10 +324,8 @@ Module { var input = inputs["android.nativelibrary"][i]; File.copy(input.filePath, FileInfo.joinPaths(product.Qt.android_support._deployQtOutDir, - "libs", - input.Android.ndk.abi, - input.baseName + "_" + input.Android.ndk.abi + - ".so")); + "libs", input.Android.ndk.abi, + input.fileName)); } } }; @@ -396,31 +394,7 @@ Module { File.remove(oldLibs[i]); } }; - - // androiddeployqt doesn't strip the deployed libraries anymore so it has to done here - var stripLibsCmd = new JavaScriptCommand(); - stripLibsCmd.description = "Stripping unneeded symbols from deployed qt libraries"; - stripLibsCmd.sourceCode = function() { - var stripArgs = ["--strip-all"]; - var architectures = []; - for (var i in inputs["android.nativelibrary"]) - architectures.push(inputs["android.nativelibrary"][i].Android.ndk.abi); - for (var i in architectures) { - var abiDirPath = FileInfo.joinPaths(product.Android.sdk.packageContentsDir, - "lib", architectures[i]); - var files = File.directoryEntries(abiDirPath, File.Files); - for (var i = 0; i < files.length; ++i) { - var filePath = FileInfo.joinPaths(abiDirPath, files[i]); - if (FileInfo.suffix(filePath) == "so") { - stripArgs.push(filePath); - } - } - } - var process = new Process(); - process.exec(product.cpp.stripPath, stripArgs, false); - } - - return [copyCmd, androidDeployQtCmd, moveCmd, stripLibsCmd]; + return [copyCmd, androidDeployQtCmd, moveCmd]; } } diff --git a/share/qbs/module-providers/Qt/templates/core.qbs b/share/qbs/module-providers/Qt/templates/core.qbs index 691e4b50c..8f0b0e2df 100644 --- a/share/qbs/module-providers/Qt/templates/core.qbs +++ b/share/qbs/module-providers/Qt/templates/core.qbs @@ -190,7 +190,8 @@ Module { return undefined; return frameworks; } - cpp.rpaths: qbs.targetOS.contains('linux') ? [libPath] : undefined + cpp.rpaths: qbs.targetOS.contains('linux') && !qbs.targetOS.contains("android") ? [libPath] : + undefined cpp.runtimeLibrary: qbs.toolchain.contains("msvc") ? config.contains("static_runtime") ? "static" : "dynamic" : original diff --git a/share/qbs/modules/Android/sdk/sdk.qbs b/share/qbs/modules/Android/sdk/sdk.qbs index b3f977689..f0e727caf 100644 --- a/share/qbs/modules/Android/sdk/sdk.qbs +++ b/share/qbs/modules/Android/sdk/sdk.qbs @@ -96,7 +96,6 @@ Module { property bool _enableRules: !product.multiplexConfigurationId && !!packageName - property bool _archInName: false property bool _bundledInAssets: true Group { diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs index 8ee8e2698..ca89bbd63 100644 --- a/share/qbs/modules/cpp/CppModule.qbs +++ b/share/qbs/modules/cpp/CppModule.qbs @@ -179,6 +179,7 @@ Module { property string executablePrefix: "" property string staticLibrarySuffix: "" property string dynamicLibrarySuffix: "" + property string archSuffix: "" property string loadableModuleSuffix: "" property string executableSuffix: "" property string debugInfoSuffix: "" diff --git a/share/qbs/modules/cpp/android-gcc.qbs b/share/qbs/modules/cpp/android-gcc.qbs index bd58cbcca..5759606aa 100644 --- a/share/qbs/modules/cpp/android-gcc.qbs +++ b/share/qbs/modules/cpp/android-gcc.qbs @@ -41,7 +41,7 @@ LinuxGCC { condition: qbs.targetOS.contains("android") && qbs.toolchain && qbs.toolchain.contains("llvm") priority: 2 - rpaths: [rpathOrigin] + rpaths: [] cxxLanguageVersion: "c++14" property string cxxStlBaseDir: FileInfo.joinPaths(Android.ndk.ndkDir, "sources", "cxx-stl") @@ -128,12 +128,7 @@ LinuxGCC { return includes; } - defines: { - var list = ["ANDROID"]; - // Might be superseded by an -mandroid-version or similar Clang compiler flag in future - list.push("__ANDROID_API__=" + Android.ndk.platformVersion); - return list; - } + defines: ["ANDROID", "__ANDROID__"] binutilsPath: FileInfo.joinPaths(Android.ndk.ndkDir, "toolchains", "llvm", "prebuilt", Android.ndk.hostArch, "bin"); @@ -158,9 +153,10 @@ LinuxGCC { } } - targetVendor: "none" + target: [targetArch, targetSystem, targetAbi].join("-") targetSystem: "linux" - targetAbi: "android" + (["armeabi", "armeabi-v7a"].contains(Android.ndk.abi) ? "eabi" : "") + targetAbi: "android" + (["armeabi", "armeabi-v7a"].contains(Android.ndk.abi) ? "eabi" : "") + + Android.ndk.platformVersion endianness: "little" diff --git a/share/qbs/modules/cpp/sdcc.js b/share/qbs/modules/cpp/sdcc.js index 4a144b466..36454031e 100644 --- a/share/qbs/modules/cpp/sdcc.js +++ b/share/qbs/modules/cpp/sdcc.js @@ -404,6 +404,7 @@ function compilerFlags(project, product, input, outputs, explicitlyDependsOn) { } // Misc flags. + escapablePreprocessorFlags = escapablePreprocessorFlags.uniqueConcat(input.cpp.cppFlags); var escapedPreprocessorFlags = escapePreprocessorFlags(escapablePreprocessorFlags); if (escapedPreprocessorFlags) Array.prototype.push.apply(args, escapedPreprocessorFlags); diff --git a/share/qbs/modules/ib/ib.js b/share/qbs/modules/ib/ib.js index 40bd1dc23..ebb615e8e 100644 --- a/share/qbs/modules/ib/ib.js +++ b/share/qbs/modules/ib/ib.js @@ -173,7 +173,7 @@ function ibtooldArguments(product, inputs, input, outputs, overrideOutput) { // --target-device and -output-partial-info-plist were introduced in Xcode 6.0 for ibtool if (ModUtils.moduleProperty(product, "ibtoolVersionMajor") >= 6 || inputs.assetcatalog) { args.push("--output-partial-info-plist", (outputs && outputs.partial_infoplist) - ? outputs.partial_infoplist[0].filePath + ? outputs.partial_infoplist[outputs.partial_infoplist.length - 1].filePath : "/dev/null"); // For iOS, we'd normally only output the devices specified in TARGETED_DEVICE_FAMILY diff --git a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs index 9f2dbc7af..47d1a60c1 100644 --- a/share/qbs/modules/protobuf/cpp/protobufcpp.qbs +++ b/share/qbs/modules/protobuf/cpp/protobufcpp.qbs @@ -15,6 +15,13 @@ ProtobufBase { property string grpcIncludePath: grpcIncludeProbe.path property string grpcLibraryPath: grpcLibraryProbe.path + readonly property string _libraryName: { + var libraryName = FileInfo.baseName(libraryProbe.fileName); + if (libraryName.startsWith("lib")) + libraryName = libraryName.substring(3); + return libraryName; + } + Depends { name: "cpp" } property path grpcPluginPath: grpcPluginProbe.filePath @@ -34,7 +41,9 @@ ProtobufBase { return result; } cpp.dynamicLibraries: { - var result = ["protobuf"]; + var result = []; + if (_libraryName) + result.push(_libraryName) if (qbs.targetOS.contains("unix")) result.push("pthread"); if (useGrpc) @@ -89,7 +98,10 @@ ProtobufBase { Probes.LibraryProbe { id: libraryProbe - names: "protobuf" + names: [ + "protobuf", + "protobufd", + ] } Probes.IncludeProbe { diff --git a/share/qbs/modules/protobuf/nanopb/nanopb.qbs b/share/qbs/modules/protobuf/nanopb/nanopb.qbs index fdf95e2fd..ae87b1ca1 100644 --- a/share/qbs/modules/protobuf/nanopb/nanopb.qbs +++ b/share/qbs/modules/protobuf/nanopb/nanopb.qbs @@ -9,9 +9,15 @@ import "../protobuf.js" as HelperFunctions ProtobufBase { property string includePath: includeProbe.path property string libraryPath: libraryProbe.path - property string pluginPath: pluginProbe.path - property string _plugin: "protoc-gen-nanopb=" + - FileInfo.joinPaths(pluginPath, "protoc-gen-nanopb") + property string pluginPath: pluginProbe.filePath + property string pluginName: "protoc-gen-nanopb" + readonly property string _plugin: "protoc-gen-nanopb=" + pluginPath + readonly property string _libraryName: { + var libraryName = FileInfo.baseName(libraryProbe.fileName); + if (libraryName.startsWith("lib")) + libraryName = libraryName.substring(3); + return libraryName; + } Depends { name: "cpp" } @@ -21,7 +27,12 @@ ProtobufBase { result.push(libraryPath); return result; } - cpp.dynamicLibraries: "protobuf-nanopb" + cpp.dynamicLibraries: { + var result = []; + if (_libraryName) + result.push(_libraryName); + return result; + } cpp.includePaths: { var result = [outputDir]; if (includePath) @@ -44,9 +55,13 @@ ProtobufBase { } prepare: { + var options = input.protobuf.nanopb.importPaths.map(function (path) { + return "-I" + path; + }) + var result = HelperFunctions.doPrepare( input.protobuf.nanopb, product, input, outputs, "nanopb", - input.protobuf.nanopb._plugin); + input.protobuf.nanopb._plugin, options); return result; } } @@ -58,12 +73,15 @@ ProtobufBase { Probes.LibraryProbe { id: libraryProbe - names: "protobuf-nanopb" + names: [ + "protobuf-nanopb", + "protobuf-nanopbd", + ] } Probes.BinaryProbe { id: pluginProbe - names: "protoc-gen-nanopb" + names: pluginName } validate: { diff --git a/share/qbs/modules/protobuf/protobuf.js b/share/qbs/modules/protobuf/protobuf.js index 0fd89856b..abc2c2c4d 100644 --- a/share/qbs/modules/protobuf/protobuf.js +++ b/share/qbs/modules/protobuf/protobuf.js @@ -86,13 +86,14 @@ function objcArtifact(outputDir, input, tags, suffix) { filePath: FileInfo.joinPaths( outputDir, toCamelCase(FileInfo.baseName(input.fileName)) + suffix), cpp: { + automaticReferenceCounting: false, includePaths: [].concat(input.cpp.includePaths, outputDir), warningLevel: "none", } } } -function doPrepare(module, product, input, outputs, generator, plugin) +function doPrepare(module, product, input, outputs, generator, plugin, generatorOptions) { var outputDir = module.outputDir; var args = []; @@ -101,6 +102,10 @@ function doPrepare(module, product, input, outputs, generator, plugin) args.push("--plugin=" + plugin) args.push("--" + generator + "_out", outputDir); + if (!!generatorOptions) { + for (var i = 0; i < generatorOptions.length; ++i) + args.push("--" + generator + "_opt=" + generatorOptions[i]) + } var importPaths = module.importPaths; if (importPaths.length === 0) |