aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py35
1 files changed, 32 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index a04ad80c4..1b4c92072 100644
--- a/setup.py
+++ b/setup.py
@@ -38,6 +38,7 @@
#############################################################################
from __future__ import print_function
+from distutils.version import LooseVersion
"""This is a distutils setup-script for the PySide2 project
@@ -94,7 +95,7 @@ OS X SDK: You can specify which OS X SDK should be used for compilation with the
For e.g. "--osx-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/".
"""
-__version__ = "5.6"
+__version__ = "5.9"
containedModules = ['shiboken2', 'pyside2']
@@ -104,6 +105,11 @@ submodules = {
["pyside2-examples", "dev"],
["wiki", "master", ".."],
],
+ '5.9': [
+ ["pyside2-tools", "5.9"],
+ ["pyside2-examples", "5.9"],
+ ["wiki", "master", ".."]
+ ],
'5.6': [
["pyside2-tools", "5.6"],
["pyside2-examples", "5.6"],
@@ -183,7 +189,7 @@ from setuptools.command.develop import develop as _develop
from setuptools.command.build_py import build_py as _build_py
from qtinfo import QtInfo
-from utils import rmtree
+from utils import rmtree, detectClang
from utils import makefile
from utils import copyfile
from utils import copydir
@@ -251,6 +257,7 @@ OPTION_REUSE_BUILD = has_option("reuse-build")
OPTION_SKIP_CMAKE = has_option("skip-cmake")
OPTION_SKIP_MAKE_INSTALL = has_option("skip-make-install")
OPTION_SKIP_PACKAGING = has_option("skip-packaging")
+OPTION_MODULE_SUBSET = option_value("module-subset")
OPTION_RPATH_VALUES = option_value("rpath")
OPTION_QT_CONF_PREFIX = option_value("qt-conf-prefix")
@@ -698,7 +705,20 @@ class pyside_build(_build):
sys.exit(1)
# Update the PATH environment variable
- update_env_path([py_scripts_dir, qt_dir])
+ additionalPaths = [py_scripts_dir, qt_dir]
+
+ # Add Clang to path for Windows. Revisit once Clang is bundled with Qt.
+ if sys.platform == "win32" and LooseVersion(self.qtinfo.version) >= LooseVersion("5.7.0"):
+ clangDir = detectClang()
+ if clangDir[0]:
+ clangBinDir = os.path.join(clangDir[0], 'bin')
+ if not clangBinDir in os.environ.get('PATH'):
+ log.info("Adding %s as detected by %s to PATH" % (clangBinDir, clangDir[1]))
+ additionalPaths.append(clangBinDir)
+ else:
+ log.error("Failed to detect Clang by checking LLVM_INSTALL_DIR, CLANG_INSTALL_DIR, llvm-config")
+
+ update_env_path(additionalPaths)
build_name = "py%s-qt%s-%s-%s" % \
(py_version, qt_version, platform.architecture()[0], build_type.lower())
@@ -860,6 +880,15 @@ class pyside_build(_build):
cmake_cmd.append("-DPYTHON_EXECUTABLE=%s" % self.py_executable)
cmake_cmd.append("-DPYTHON_INCLUDE_DIR=%s" % self.py_include_dir)
cmake_cmd.append("-DPYTHON_LIBRARY=%s" % self.py_library)
+ if OPTION_MODULE_SUBSET:
+ moduleSubSet = ''
+ for m in OPTION_MODULE_SUBSET.split(','):
+ if m.startswith('Qt'):
+ m = m[2:]
+ if moduleSubSet:
+ moduleSubSet += ';'
+ moduleSubSet += m
+ cmake_cmd.append("-DMODULES=%s" % moduleSubSet)
# Add source location for generating documentation
if qtSrcDir:
cmake_cmd.append("-DQT_SRC_DIR=%s" % qtSrcDir)