diff options
| author | Tobias Markmann <tm@ayena.de> | 2015-09-10 08:45:48 (GMT) |
|---|---|---|
| committer | Swift Review <review@swift.im> | 2015-10-16 11:22:17 (GMT) |
| commit | f5b5f35868b3f1fd93906d6458cca965f12c6a5f (patch) | |
| tree | 5c87e9217cc6d4e7a2b1d04b696b5f2d7c794daf | |
| parent | 3a2b966711dbe6fa937c485d7ad56916219badb2 (diff) | |
| download | swift-f5b5f35868b3f1fd93906d6458cca965f12c6a5f.zip swift-f5b5f35868b3f1fd93906d6458cca965f12c6a5f.tar.bz2 | |
Do not require complete Qt installation when building Swiften
Previously, if a base installation of Qt was available but not
all Qt modules required by Swift are available Scons would fail
configuration. If a basic Qt installation is available SCons will
try to configure Swift even if you only want to build Swiften.
This commit changes the hard failure in Swift configuration to a
warning. This allows only Swiften to be build.
In addition, the warning now lists the Qt packages required by
Swift.
Test-Information:
Tested on Arch Linux.
Change-Id: I220ea61a7e4af849912e1fb1ae66cbecf5136d29
| -rw-r--r-- | BuildTools/SCons/Tools/qt4.py | 2 | ||||
| -rw-r--r-- | Swift/SConscript | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/BuildTools/SCons/Tools/qt4.py b/BuildTools/SCons/Tools/qt4.py index 6c54b1e..6d9285c 100644 --- a/BuildTools/SCons/Tools/qt4.py +++ b/BuildTools/SCons/Tools/qt4.py | |||
| @@ -515,11 +515,11 @@ def enable_modules(self, modules, debug=False, crosscompiling=False, version='4' | |||
| 515 | 515 | ||
| 516 | # Check if Qt is registered at pkg-config | 516 | # Check if Qt is registered at pkg-config |
| 517 | ret = test_conf.TryAction('pkg-config --exists \'%s\'' % modules_str)[0] | 517 | ret = test_conf.TryAction('pkg-config --exists \'%s\'' % modules_str)[0] |
| 518 | if ret != 1: | 518 | if ret != 1: |
| 519 | test_conf.Finish() | 519 | test_conf.Finish() |
| 520 | raise Exception("Qt has not been found using pkg-config.") | 520 | raise Exception('Qt installation is missing packages. The following are required: %s' % modules_str) |
| 521 | return | 521 | return |
| 522 | test_conf.env.ParseConfig("pkg-config --cflags --libs " + modules_str) | 522 | test_conf.env.ParseConfig("pkg-config --cflags --libs " + modules_str) |
| 523 | self.AppendUnique(LIBS=test_conf.env["LIBS"], LIBPATH=test_conf.env["LIBPATH"], CPPPATH=test_conf.env["CPPPATH"]) | 523 | self.AppendUnique(LIBS=test_conf.env["LIBS"], LIBPATH=test_conf.env["LIBPATH"], CPPPATH=test_conf.env["CPPPATH"]) |
| 524 | self["QT4_MOCCPPPATH"] = self["CPPPATH"] | 524 | self["QT4_MOCCPPPATH"] = self["CPPPATH"] |
| 525 | test_conf.Finish() | 525 | test_conf.Finish() |
diff --git a/Swift/SConscript b/Swift/SConscript index 566019c..31b0b94 100644 --- a/Swift/SConscript +++ b/Swift/SConscript | |||
| @@ -11,7 +11,11 @@ if env["SCONS_STAGE"] == "build" : | |||
| 11 | env["PROJECTS"].remove("Swift") | 11 | env["PROJECTS"].remove("Swift") |
| 12 | elif not GetOption("help") and not env.get("HAVE_QT", 0) : | 12 | elif not GetOption("help") and not env.get("HAVE_QT", 0) : |
| 13 | if "Swift" in env["PROJECTS"] : | 13 | if "Swift" in env["PROJECTS"] : |
| 14 | print "Warning: Swift requires Qt. Not building the Swift Qt application." | 14 | print "Warning: Swift requires Qt. Not building the Swift Qt application." |
| 15 | env["PROJECTS"].remove("Swift") | 15 | env["PROJECTS"].remove("Swift") |
| 16 | elif not GetOption("help") and env["target"] == "native": | 16 | elif not GetOption("help") and env["target"] == "native" and "Swift" in env["PROJECTS"] : |
| 17 | SConscript("QtUI/SConscript") | 17 | try : |
| 18 | SConscript("QtUI/SConscript") | ||
| 19 | except Exception as e: | ||
| 20 | print "Warning: %s" % str(e) | ||
| 21 | env["PROJECTS"].remove("Swift") | ||
Swift