diff options
| -rw-r--r-- | BuildTools/SCons/Tools/qt4.py | 17 |
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 | |||
| 43 | import SCons.Scanner | 43 | import SCons.Scanner |
| 44 | import SCons.Tool | 44 | import SCons.Tool |
| 45 | import SCons.Util | 45 | import SCons.Util |
| 46 | 46 | import SCons.SConf | |
| 47 | Import("conf_env") | ||
| 48 | 47 | ||
| 49 | class ToolQtWarning(SCons.Warnings.Warning): | 48 | class ToolQtWarning(SCons.Warnings.Warning): |
| 50 | pass | 49 | pass |
| @@ -504,20 +503,18 @@ def enable_modules(self, modules, debug=False, crosscompiling=False, version='4' | |||
| 504 | self["QT4_MOCCPPPATH"] = self["CPPPATH"] | 503 | self["QT4_MOCCPPPATH"] = self["CPPPATH"] |
| 505 | return | 504 | return |
| 506 | else: | 505 | else: |
| 507 | test_env = self.Clone() | 506 | test_conf = self.Configure() |
| 508 | test_conf = Configure(test_env) | ||
| 509 | modules_str = " ".join(modules) | 507 | modules_str = " ".join(modules) |
| 510 | if not version == '4' : | 508 | if not version == '4' : |
| 511 | modules_str = modules_str.replace('Qt', 'Qt5') | 509 | modules_str = modules_str.replace('Qt', 'Qt5') |
| 512 | 510 | ||
| 513 | # Check if Qt is registed at pkg-config | 511 | # Check if Qt is registered at pkg-config |
| 514 | ret = test_conf.TryAction('pkg-config --exists \'%s\'' % modules_str)[0] | 512 | ret = test_conf.TryAction('pkg-config --exists \'%s\'' % modules_str)[0] |
| 515 | test_conf.Result( ret ) | 513 | if ret != 1: |
| 516 | if not ret: | 514 | raise Exception("Qt has not been found using pkg-config.") |
| 517 | print("Qt not found.") | ||
| 518 | return | 515 | return |
| 519 | test_env.ParseConfig("pkg-config --cflags --libs " + modules_str) | 516 | test_conf.env.ParseConfig("pkg-config --cflags --libs " + modules_str) |
| 520 | self.AppendUnique(LIBS=test_env["LIBS"], LIBPATH=test_env["LIBPATH"], CPPPATH=test_env["CPPPATH"]) | 517 | self.AppendUnique(LIBS=test_conf.env["LIBS"], LIBPATH=test_conf.env["LIBPATH"], CPPPATH=test_conf.env["CPPPATH"]) |
| 521 | self["QT4_MOCCPPPATH"] = self["CPPPATH"] | 518 | self["QT4_MOCCPPPATH"] = self["CPPPATH"] |
| 522 | return | 519 | return |
| 523 | 520 | ||
Swift