diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-28 15:47:52 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-08-28 15:47:52 +0200 |
commit | 811edc5952caf265a4c56b52933165830838dab1 (patch) | |
tree | 787ef28916e4799083aa1b7e0d5076a35d130eca /share | |
parent | 40787b4d077eea1211f43d9f247c560957bd6887 (diff) | |
parent | 0f647796788494947632c0874931e4d84bccad46 (diff) |
Merge 1.9 into master
Change-Id: I5320b7c62d6a80089df75c2caca79c15602c01e5
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/modules/cpp/android-gcc.qbs | 34 | ||||
-rw-r--r-- | share/qbs/modules/cpp/msvc.js | 25 | ||||
-rw-r--r-- | share/qbs/modules/cpp/windows-mingw.qbs | 6 |
3 files changed, 53 insertions, 12 deletions
diff --git a/share/qbs/modules/cpp/android-gcc.qbs b/share/qbs/modules/cpp/android-gcc.qbs index 5307c06a4..a21f56f2a 100644 --- a/share/qbs/modules/cpp/android-gcc.qbs +++ b/share/qbs/modules/cpp/android-gcc.qbs @@ -85,6 +85,13 @@ LinuxGCC { ? FileInfo.joinPaths(stlLibsDir, staticLibraryPrefix + Android.ndk.appStl + staticLibrarySuffix) : undefined + Group { + name: "Android STL" + condition: product.cpp.sharedStlFilePath + files: product.cpp.sharedStlFilePath ? [product.cpp.sharedStlFilePath] : [] + fileTags: ["android.unstripped-stl"] + } + toolchainInstallPath: FileInfo.joinPaths(Android.ndk.ndkDir, "toolchains", toolchainDir, "prebuilt", Android.ndk.hostArch, "bin") @@ -203,7 +210,22 @@ LinuxGCC { endianness: "little" Rule { + inputs: ["android.unstripped-stl"] + Artifact { + filePath: FileInfo.joinPaths("stripped-libs", input.fileName); + fileTags: ["android.stripped-stl"] + } + prepare: { + var args = ["--strip-unneeded", "-o", output.filePath, input.filePath]; + var cmd = new Command(product.cpp.stripPath, args); + cmd.description = "stripping " + input.fileName; + return [cmd]; + } + } + + Rule { inputs: ["dynamiclibrary"] + explicitlyDependsOn: ["android.stripped-stl"]; outputFileTags: ["android.nativelibrary", "android.gdbserver-info", "android.stl-info"] outputArtifacts: { var artifacts = [{ @@ -217,17 +239,14 @@ LinuxGCC { fileTags: ["android.gdbserver-info"] }); } - var stlFilePath = product.moduleProperty("cpp", "sharedStlFilePath"); - if (stlFilePath) + if (explicitlyDependsOn["android.stripped-stl"]) artifacts.push({filePath: "android.stl-info.txt", fileTags: ["android.stl-info"]}); return artifacts; } prepare: { - var stlFilePath = product.moduleProperty("cpp", "sharedStlFilePath"); var copyCmd = new JavaScriptCommand(); copyCmd.silent = true; - copyCmd.stlFilePath = stlFilePath; copyCmd.sourceCode = function() { File.copy(inputs["dynamiclibrary"][0].filePath, outputs["android.nativelibrary"][0].filePath); @@ -246,8 +265,9 @@ LinuxGCC { infoFile.writeLine(targetPath); infoFile.close(); } - if (stlFilePath) { - var srcPath = stlFilePath; + var strippedStlList = explicitlyDependsOn["android.stripped-stl"]; + if (strippedStlList) { + var srcPath = strippedStlList[0].filePath; var targetPath = FileInfo.joinPaths(destDir, FileInfo.fileName(srcPath)); var infoFile = new TextFile(outputs["android.stl-info"][0].filePath, TextFile.WriteOnly); @@ -257,8 +277,6 @@ LinuxGCC { } } var stripArgs = ["--strip-unneeded", outputs["android.nativelibrary"][0].filePath]; - if (stlFilePath) - stripArgs.push(stlFilePath); var stripCmd = new Command(product.moduleProperty("cpp", "stripPath"), stripArgs); stripCmd.description = "Stripping unneeded symbols from " + outputs["android.nativelibrary"][0].fileName; diff --git a/share/qbs/modules/cpp/msvc.js b/share/qbs/modules/cpp/msvc.js index 4d12ee427..13e5d8821 100644 --- a/share/qbs/modules/cpp/msvc.js +++ b/share/qbs/modules/cpp/msvc.js @@ -57,6 +57,25 @@ function handleCpuFeatures(input, flags) { } } +function addLanguageVersionFlag(input, args) { + var cxxVersion = input.cpp.cxxLanguageVersion; + if (!cxxVersion) + return; + + // Visual C++ 2013, Update 3 + var hasStdOption = Utilities.versionCompare(input.cpp.compilerVersion, "18.00.30723") >= 0; + if (!hasStdOption) + return; + + var flag; + if (cxxVersion === "c++14") + flag = "/std:c++14"; + else if (cxxVersion !== "c++11" && cxxVersion !== "c++98") + flag = "/std:c++latest"; + if (flag) + args.push(flag); +} + function prepareCompiler(project, product, inputs, outputs, input, output, explicitlyDependsOn) { var i; var debugInformation = input.cpp.debugInformation; @@ -164,10 +183,12 @@ function prepareCompiler(project, product, inputs, outputs, input, output, expli args.push("/FI" + FileInfo.toWindowsSeparators(prefixHeaders[i])); // Language - if (tag === "cpp") + if (tag === "cpp") { args.push("/TP"); - else if (tag === "c") + addLanguageVersionFlag(input, args); + } else if (tag === "c") { args.push("/TC"); + } // Whether we're compiling a precompiled header or normal source file var pchOutput = outputs[tag + "_pch"] ? outputs[tag + "_pch"][0] : undefined; diff --git a/share/qbs/modules/cpp/windows-mingw.qbs b/share/qbs/modules/cpp/windows-mingw.qbs index fec31cf3f..2fe96495e 100644 --- a/share/qbs/modules/cpp/windows-mingw.qbs +++ b/share/qbs/modules/cpp/windows-mingw.qbs @@ -85,15 +85,17 @@ GenericGCC { } prepare: { + var inputList = inputs["native.pe.manifest"]; // TODO: Emulate manifest merging like Microsoft's mt.exe tool does - if (inputs.length !== 1) + if (inputList.length !== 1) { throw("The MinGW toolchain does not support manifest merging; " + "you may only specify a single manifest file to embed into your assembly."); + } var cmd = new JavaScriptCommand(); cmd.silent = true; cmd.productType = product.type; - cmd.inputFilePath = inputs[0].filePath; + cmd.inputFilePath = inputList[0].filePath; cmd.outputFilePath = output.filePath; cmd.sourceCode = function() { var tf; |