diff options
author | Tobias Markmann <tm@ayena.de> | 2015-05-12 12:59:02 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2015-05-19 07:37:41 (GMT) |
commit | 55e0ca2aa1f2216121ecf17126caf8bdd4f3094b (patch) | |
tree | 4142f875555f4f2e8035edb2d5cd551bc78dd677 /BuildTools/SCons/Tools | |
parent | 39342e46bdf3a2b12bff5bd267809bf4dfc277b5 (diff) | |
download | swift-55e0ca2aa1f2216121ecf17126caf8bdd4f3094b.zip swift-55e0ca2aa1f2216121ecf17126caf8bdd4f3094b.tar.bz2 |
Gracefully handle pkg-config when Qt is not installed
Test-Information:
Tested on Elementary OS 0.2.0. Without this patch scons crashed if not
all required Qt libs are installed. Now it marks Qt as unavailable and
will configure a build without Swift.
Change-Id: I5aa28ab8438e4c326d16413deb3a3fa739c94480
Diffstat (limited to 'BuildTools/SCons/Tools')
-rw-r--r-- | BuildTools/SCons/Tools/qt4.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/BuildTools/SCons/Tools/qt4.py b/BuildTools/SCons/Tools/qt4.py index 17292d9..f4b59e3 100644 --- a/BuildTools/SCons/Tools/qt4.py +++ b/BuildTools/SCons/Tools/qt4.py @@ -506,6 +506,13 @@ def enable_modules(self, modules, debug=False, crosscompiling=False, version='4' modules_str = " ".join(modules) if not version == '4' : modules_str = modules_str.replace('Qt', 'Qt5') + + # Check if Qt is registed at pkg-config + ret = test_env.TryAction('pkg-config --exists \'%s\'' % modules_str)[0] + test_env.Result( ret ) + if not ret: + print("Qt not found.") + return test_env.ParseConfig("pkg-config --cflags --libs " + modules_str) self.AppendUnique(LIBS=test_env["LIBS"], LIBPATH=test_env["LIBPATH"], CPPPATH=test_env["CPPPATH"]) self["QT4_MOCCPPPATH"] = self["CPPPATH"] |