diff options
author | Raphael Cotty <raphael.cotty@gmail.com> | 2022-02-23 10:56:25 +0100 |
---|---|---|
committer | Raphaƫl Cotty <raphael.cotty@gmail.com> | 2022-08-08 14:12:30 +0000 |
commit | 4c47fbfb0812fc1ce90fd26411382e3c3bb7f839 (patch) | |
tree | d5ecfa7411d57604440d3152bbd5db9b66b47d33 /share/qbs | |
parent | 410663de171a2db695bd17075042ee8a7372a890 (diff) | |
download | qbs-4c47fbfb0812fc1ce90fd26411382e3c3bb7f839.tar.gz |
Add executableSuffix to the FileInfo service
Change-Id: I86c24c6ad1ea0daf298b71501a6719c8b2650c1c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'share/qbs')
-rw-r--r-- | share/qbs/imports/qbs/Probes/ConanfileProbe.qbs | 3 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/setup-qt.js | 2 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/templates/qmlcache.qbs | 3 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/templates/quick.js | 2 | ||||
-rw-r--r-- | share/qbs/module-providers/Qt/templates/quick.qbs | 2 | ||||
-rw-r--r-- | share/qbs/module-providers/qbspkgconfig.qbs | 3 | ||||
-rw-r--r-- | share/qbs/modules/cpp/CppModule.qbs | 4 | ||||
-rw-r--r-- | share/qbs/modules/typescript/TypeScriptModule.qbs | 3 |
8 files changed, 9 insertions, 13 deletions
diff --git a/share/qbs/imports/qbs/Probes/ConanfileProbe.qbs b/share/qbs/imports/qbs/Probes/ConanfileProbe.qbs index 32fbcace2..097b1b6f1 100644 --- a/share/qbs/imports/qbs/Probes/ConanfileProbe.qbs +++ b/share/qbs/imports/qbs/Probes/ConanfileProbe.qbs @@ -31,7 +31,6 @@ import qbs.Process import qbs.File import qbs.FileInfo -import qbs.Host import qbs.TextFile import qbs.Utilities @@ -40,7 +39,7 @@ Probe { property stringList additionalArguments: [] property path conanfilePath property path packageReference - property path executable: "conan" + (Host.os().contains("windows") ? ".exe": "") + property path executable: "conan" + FileInfo.executableSuffix() property stringList generators: ["json"] property var options property var settings diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js index a8fbf9dae..db3ff67b8 100644 --- a/share/qbs/module-providers/Qt/setup-qt.js +++ b/share/qbs/module-providers/Qt/setup-qt.js @@ -48,7 +48,7 @@ var Utilities = require("qbs.Utilities"); function splitNonEmpty(s, c) { return s.split(c).filter(function(e) { return e; }); } function toNative(p) { return FileInfo.toNativeSeparators(p); } -function exeSuffix(qbs) { return Host.os().contains("windows") ? ".exe" : ""; } +function exeSuffix(qbs) { return FileInfo.executableSuffix(); } function getQmakeFilePaths(qmakeFilePaths, qbs) { if (qmakeFilePaths && qmakeFilePaths.length > 0) diff --git a/share/qbs/module-providers/Qt/templates/qmlcache.qbs b/share/qbs/module-providers/Qt/templates/qmlcache.qbs index 9a5956884..7047884c0 100644 --- a/share/qbs/module-providers/Qt/templates/qmlcache.qbs +++ b/share/qbs/module-providers/Qt/templates/qmlcache.qbs @@ -1,6 +1,5 @@ import qbs.File import qbs.FileInfo -import qbs.Host import qbs.Process import qbs.Utilities @@ -11,7 +10,7 @@ Module { throw "qmlcachegen unsupported for this target"; } property string qmlCacheGenPath: FileInfo.joinPaths(Qt.core.qmlLibExecPath, "qmlcachegen") - + (Host.os().contains("windows") ? ".exe" : "") + + FileInfo.executableSuffix() property bool supportsAllArchitectures: Utilities.versionCompare(Qt.core.version, "5.11") >= 0 property string installDir diff --git a/share/qbs/module-providers/Qt/templates/quick.js b/share/qbs/module-providers/Qt/templates/quick.js index e677143ea..d7e58984f 100644 --- a/share/qbs/module-providers/Qt/templates/quick.js +++ b/share/qbs/module-providers/Qt/templates/quick.js @@ -37,7 +37,7 @@ function scanQrc(product, qrcFilePath) { var result = []; var process = new Process(); try { - var rcc = FileInfo.joinPaths(Rcc.fullPath(product) + product.cpp.executableSuffix); + var rcc = FileInfo.joinPaths(Rcc.fullPath(product) + FileInfo.executableSuffix()); var exitCode = process.exec(rcc, ["--list", qrcFilePath], true); for (;;) { var line = process.readLine(); diff --git a/share/qbs/module-providers/Qt/templates/quick.qbs b/share/qbs/module-providers/Qt/templates/quick.qbs index 276246d6d..27f49cbd6 100644 --- a/share/qbs/module-providers/Qt/templates/quick.qbs +++ b/share/qbs/module-providers/Qt/templates/quick.qbs @@ -75,7 +75,7 @@ QtModule { : Qt.core.binPath property string compilerBaseName: (_compilerIsQmlCacheGen ? "qmlcachegen" : "qtquickcompiler") property string compilerFilePath: FileInfo.joinPaths(_compilerBaseDir, - compilerBaseName + product.cpp.executableSuffix) + compilerBaseName + FileInfo.executableSuffix()) property bool compilerAvailable: File.exists(compilerFilePath); property bool useCompiler: compilerAvailable && !_compilerIsQmlCacheGen diff --git a/share/qbs/module-providers/qbspkgconfig.qbs b/share/qbs/module-providers/qbspkgconfig.qbs index fc162320c..2af3c42e4 100644 --- a/share/qbs/module-providers/qbspkgconfig.qbs +++ b/share/qbs/module-providers/qbspkgconfig.qbs @@ -40,7 +40,6 @@ import qbs.Environment import qbs.File import qbs.FileInfo -import qbs.Host import qbs.ModUtils import qbs.PkgConfig import qbs.Process @@ -62,7 +61,7 @@ ModuleProvider { relativeSearchPaths: { - function exeSuffix(qbs) { return Host.os().contains("windows") ? ".exe" : ""; } + function exeSuffix(qbs) { return FileInfo.executableSuffix(); } // we need Probes in Providers... function getPkgConfigExecutable(qbs) { diff --git a/share/qbs/modules/cpp/CppModule.qbs b/share/qbs/modules/cpp/CppModule.qbs index 038de8617..bd1eaa242 100644 --- a/share/qbs/modules/cpp/CppModule.qbs +++ b/share/qbs/modules/cpp/CppModule.qbs @@ -29,7 +29,7 @@ ****************************************************************************/ // base for Cpp modules -import qbs.Host +import qbs.FileInfo import qbs.ModUtils import qbs.Utilities import qbs.WindowsUtils @@ -217,7 +217,7 @@ Module { property stringList knownArchitectures: [] property var toolchainDetails - property string compilerExtension: Host.os().contains("windows") ? ".exe" : "" + property string compilerExtension: FileInfo.executableSuffix() property string linkerMode: "automatic" PropertyOptions { diff --git a/share/qbs/modules/typescript/TypeScriptModule.qbs b/share/qbs/modules/typescript/TypeScriptModule.qbs index c8ca270e0..76df529c2 100644 --- a/share/qbs/modules/typescript/TypeScriptModule.qbs +++ b/share/qbs/modules/typescript/TypeScriptModule.qbs @@ -30,7 +30,6 @@ import qbs.File import qbs.FileInfo -import qbs.Host import qbs.ModUtils import qbs.Probes import qbs.Process @@ -130,7 +129,7 @@ Module { var preValidator = new ModUtils.PropertyValidator("nodejs"); preValidator.addCustomValidator("interpreterFileName", nodejs.interpreterFileName, function (value) { - return value === "node" + (Host.os().contains("windows") ? ".exe" : ""); + return value === "node" + FileInfo.executableSuffix(); }, interpreterMessage); preValidator.addCustomValidator("interpreterFilePath", nodejs.interpreterFilePath, function (value) { return value.endsWith(nodejs.interpreterFileName); |