summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-06-08 19:10:52 (GMT)
committerKevin Smith <kevin.smith@isode.com>2015-06-14 15:03:54 (GMT)
commita510bfe657067999904a7ff8d2cabab7b8b508d2 (patch)
tree5c1340bd3cd5d05581784db696e22083b931ee24
parent93248fdd5a4974a00c1dec6068950c61f58b84fe (diff)
downloadswift-a510bfe657067999904a7ff8d2cabab7b8b508d2.zip
swift-a510bfe657067999904a7ff8d2cabab7b8b508d2.tar.bz2
Fix SCons qt4 tool pkg-config detection
Correctly use pkg-config to test for Qt, if no qt path is specified in config.py. 'Import(…)' at the top caused an error which was hidden by try/catch at upper layer. Test-Information: Tested on Kubuntu 14.04, with and w/o qt path set and verified that no exception is thrown if Qt is registered at pkg-config. Change-Id: I82800c23e9f75bd5f6b136fe384a70165a92bb45
-rw-r--r--BuildTools/SCons/Tools/qt4.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/BuildTools/SCons/Tools/qt4.py b/BuildTools/SCons/Tools/qt4.py
index 1c82324..afa61de 100644
--- a/BuildTools/SCons/Tools/qt4.py
+++ b/BuildTools/SCons/Tools/qt4.py
@@ -43,8 +43,7 @@ import SCons.Defaults
import SCons.Scanner
import SCons.Tool
import SCons.Util
-
-Import("conf_env")
+import SCons.SConf
class ToolQtWarning(SCons.Warnings.Warning):
pass
@@ -504,20 +503,18 @@ def enable_modules(self, modules, debug=False, crosscompiling=False, version='4'
self["QT4_MOCCPPPATH"] = self["CPPPATH"]
return
else:
- test_env = self.Clone()
- test_conf = Configure(test_env)
+ test_conf = self.Configure()
modules_str = " ".join(modules)
if not version == '4' :
modules_str = modules_str.replace('Qt', 'Qt5')
- # Check if Qt is registed at pkg-config
+ # Check if Qt is registered at pkg-config
ret = test_conf.TryAction('pkg-config --exists \'%s\'' % modules_str)[0]
- test_conf.Result( ret )
- if not ret:
- print("Qt not found.")
+ if ret != 1:
+ raise Exception("Qt has not been found using pkg-config.")
return
- test_env.ParseConfig("pkg-config --cflags --libs " + modules_str)
- self.AppendUnique(LIBS=test_env["LIBS"], LIBPATH=test_env["LIBPATH"], CPPPATH=test_env["CPPPATH"])
+ test_conf.env.ParseConfig("pkg-config --cflags --libs " + modules_str)
+ self.AppendUnique(LIBS=test_conf.env["LIBS"], LIBPATH=test_conf.env["LIBPATH"], CPPPATH=test_conf.env["CPPPATH"])
self["QT4_MOCCPPPATH"] = self["CPPPATH"]
return