aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-03-09 17:21:41 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2017-03-13 19:19:23 +0000
commit2a6ddd8ab3894763dac1cb779e018c57ccf9eacb (patch)
tree4ac7081937089fcb0ac5b2e5051d6357ccf40170 /share
parentd15c50751ed660327408d50283b5709ad9b6c10e (diff)
Let toolchains configure themselves if the binary is in the PATH
This will allow us to build without a profile. Change-Id: Ie1bfed8590c876342668fc359b0bd49e35a3a0d2 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qbs/modules/cpp/GenericGCC.qbs9
-rw-r--r--share/qbs/modules/cpp/windows-msvc.qbs9
2 files changed, 16 insertions, 2 deletions
diff --git a/share/qbs/modules/cpp/GenericGCC.qbs b/share/qbs/modules/cpp/GenericGCC.qbs
index d346e9a54..9e25206d3 100644
--- a/share/qbs/modules/cpp/GenericGCC.qbs
+++ b/share/qbs/modules/cpp/GenericGCC.qbs
@@ -43,6 +43,12 @@ import 'gcc.js' as Gcc
CppModule {
condition: false
+ Probes.BinaryProbe {
+ id: compilerPathProbe
+ condition: !toolchainInstallPath
+ names: [compilerName]
+ }
+
Probes.GccProbe {
id: gccProbe
compilerFilePath: compilerPath
@@ -83,7 +89,8 @@ CppModule {
property string targetAbi: "unknown"
property string toolchainPrefix
- property path toolchainInstallPath
+ property string toolchainInstallPath: compilerPathProbe.found ? compilerPathProbe.path
+ : undefined
assemblerName: 'as'
compilerName: cxxCompilerName
linkerName: 'ld'
diff --git a/share/qbs/modules/cpp/windows-msvc.qbs b/share/qbs/modules/cpp/windows-msvc.qbs
index 134de44b3..00df214f8 100644
--- a/share/qbs/modules/cpp/windows-msvc.qbs
+++ b/share/qbs/modules/cpp/windows-msvc.qbs
@@ -45,6 +45,12 @@ CppModule {
id: module
+ Probes.BinaryProbe {
+ id: compilerPathProbe
+ condition: !toolchainInstallPath
+ names: ["cl"]
+ }
+
Probes.MsvcProbe {
id: msvcProbe
compilerFilePath: compilerPath
@@ -89,7 +95,8 @@ CppModule {
separateDebugInformation: true
property bool generateManifestFile: true
- property path toolchainInstallPath
+ property string toolchainInstallPath: compilerPathProbe.found ? compilerPathProbe.path
+ : undefined
architecture: qbs.architecture
staticLibraryPrefix: ""
dynamicLibraryPrefix: ""