path: root/setup.py
diff options
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-03-05 14:03:05 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-03-06 12:02:42 +0000
commitf92869113a1421494e62a17c1ab3bd86cdff7e18 (patch)
tree6472cc9963e78a6d3f6b42cec394979181283432 /setup.py
parent471b05f35a9c57d7fa910cf9f11c7f5fdfbf2a93 (diff)
Check for compatible Qt version when building PySide2
Shiboken uses C++11 constructs like qAsConst, which necessitates the usage of a Qt version >= 5.7. Instead of showing weird compilation errors when building against Qt 5.6, print a nice error message. Change-Id: Iea4bd41dbe1d7d05e9b28bfa6654f68c6633cd74 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'setup.py')
1 files changed, 6 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 94fecfb4e..559e9286f 100644
--- a/setup.py
+++ b/setup.py
@@ -411,7 +411,12 @@ def get_qt_version():
qt_version = qtinfo.version
if not qt_version:
- log.error("Failed to query the Qt version with qmake %s" % self.qtinfo.qmake_command)
+ log.error("Failed to query the Qt version with qmake {0}".format(self.qtinfo.qmake_command))
+ sys.exit(1)
+ if LooseVersion(qtinfo.version) < LooseVersion("5.7"):
+ m = "Incompatible Qt version detected: {0}. A Qt version >= 5.7 is required."
+ log.error(m.format(qt_version))
return qt_version