Fix issue with FileInfo.executableSuffix().

This commit is contained in:
Roman Telezhynskyi 2023-02-24 15:32:32 +02:00
parent a21e1ddcd4
commit fdb8fc8f1f

View File

@ -28,6 +28,7 @@
** **
****************************************************************************/ ****************************************************************************/
import qbs
import qbs.Process import qbs.Process
import qbs.File import qbs.File
import qbs.FileInfo import qbs.FileInfo
@ -39,7 +40,7 @@ Probe {
property stringList additionalArguments: [] property stringList additionalArguments: []
property path conanfilePath property path conanfilePath
property path packageReference property path packageReference
property path executable: "conan" + FileInfo.executableSuffix() property path executable: "conan"
property stringList generators: [] property stringList generators: []
property var options property var options
property var settings property var settings
@ -56,7 +57,13 @@ Probe {
property int _conanfileLastModified: conanfilePath ? File.lastModified(conanfilePath) : 0 property int _conanfileLastModified: conanfilePath ? File.lastModified(conanfilePath) : 0
property path _projectBuildDirectory: project.buildDirectory property path _projectBuildDirectory: project.buildDirectory
// TODO: If minimal qbs version is 1.23 replace with FileInfo.executableSuffix()
readonly property string executableSuffix: project.qbs.targetOS.contains("windows") ? ".exe" : ""
configure: { configure: {
if (executable === "conan")
executable = executable + executableSuffix;
if (conanfilePath && packageReference) if (conanfilePath && packageReference)
throw("conanfilePath and packageReference must not be defined at the same time."); throw("conanfilePath and packageReference must not be defined at the same time.");