diff options
| author | Tobias Markmann <tm@ayena.de> | 2015-06-02 10:08:05 (GMT) |
|---|---|---|
| committer | Tobias Markmann <tm@ayena.de> | 2015-06-02 10:08:05 (GMT) |
| commit | dba9757d5805ab308b56c9e623a076426b2dd4c2 (patch) | |
| tree | 538dc19776e92e8c04e120d3202e6eb1595beeb6 | |
| parent | 44f48755200c7185fcae53e9e944e3a50e8806a5 (diff) | |
| download | swift-dba9757d5805ab308b56c9e623a076426b2dd4c2.zip swift-dba9757d5805ab308b56c9e623a076426b2dd4c2.tar.bz2 | |
Fix qt4.py Scons module pkg-config support in case Qt is not present
Test-Information:
Tested on Elementary OS 0.2.1 with all Qt components uninstalled.
Previously it would abort configuration and build. Now it simply builds
without Swift and other parts depending on Qt.
Change-Id: I84c91985a0ba1fdab98e97f80621cd41e0a7507b
| -rw-r--r-- | BuildTools/SCons/Tools/qt4.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/BuildTools/SCons/Tools/qt4.py b/BuildTools/SCons/Tools/qt4.py index f4b59e3..1c82324 100644 --- a/BuildTools/SCons/Tools/qt4.py +++ b/BuildTools/SCons/Tools/qt4.py | |||
| @@ -44,6 +44,8 @@ import SCons.Scanner | |||
| 44 | import SCons.Tool | 44 | import SCons.Tool |
| 45 | import SCons.Util | 45 | import SCons.Util |
| 46 | 46 | ||
| 47 | Import("conf_env") | ||
| 48 | |||
| 47 | class ToolQtWarning(SCons.Warnings.Warning): | 49 | class ToolQtWarning(SCons.Warnings.Warning): |
| 48 | pass | 50 | pass |
| 49 | 51 | ||
| @@ -503,13 +505,14 @@ def enable_modules(self, modules, debug=False, crosscompiling=False, version='4' | |||
| 503 | return | 505 | return |
| 504 | else: | 506 | else: |
| 505 | test_env = self.Clone() | 507 | test_env = self.Clone() |
| 508 | test_conf = Configure(test_env) | ||
| 506 | modules_str = " ".join(modules) | 509 | modules_str = " ".join(modules) |
| 507 | if not version == '4' : | 510 | if not version == '4' : |
| 508 | modules_str = modules_str.replace('Qt', 'Qt5') | 511 | modules_str = modules_str.replace('Qt', 'Qt5') |
| 509 | 512 | ||
| 510 | # Check if Qt is registed at pkg-config | 513 | # Check if Qt is registed at pkg-config |
| 511 | ret = test_env.TryAction('pkg-config --exists \'%s\'' % modules_str)[0] | 514 | ret = test_conf.TryAction('pkg-config --exists \'%s\'' % modules_str)[0] |
| 512 | test_env.Result( ret ) | 515 | test_conf.Result( ret ) |
| 513 | if not ret: | 516 | if not ret: |
| 514 | print("Qt not found.") | 517 | print("Qt not found.") |
| 515 | return | 518 | return |
Swift