aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-05-23 11:31:48 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-06-06 14:45:13 +0000
commit88ae63d398fe1ca60802adcf5c92a2dec29b85d0 (patch)
tree1d3fa80d670e750747e1514bdb332cdb81c12829
parent1e05405a9826c4fcc98ab44814abca44741ff01f (diff)
testrunner.py/Windows: Add Clang to the path
It is required for shiboken's ApiExtractor tests. Move subroutine detectClang into utils.py for usage by testrunner.py/setup.py. Task-number: PYSIDE-431 Change-Id: I9f1984ea9fc9857ad3e7fddf621884fdc96ef52f Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--setup.py18
-rw-r--r--testrunner.py13
-rw-r--r--utils.py18
3 files changed, 32 insertions, 17 deletions
diff --git a/setup.py b/setup.py
index cfc6c9dea..2c0ca3d41 100644
--- a/setup.py
+++ b/setup.py
@@ -170,7 +170,7 @@ from setuptools.command.bdist_egg import bdist_egg as _bdist_egg
from setuptools.command.develop import develop as _develop
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
@@ -350,22 +350,6 @@ def prefix():
name += 'd'
return name
-def detectClang():
- source = 'LLVM_INSTALL_DIR'
- clangDir = os.environ.get(source, None)
- if not clangDir:
- source = 'CLANG_INSTALL_DIR'
- clangDir = os.environ.get(source, None)
- if not clangDir:
- source = 'llvm-config'
- try:
- output = run_process_output([source, '--prefix'])
- if output:
- clangDir = output[0]
- except:
- pass
- return [clangDir, source]
-
# Initialize, pull and checkout submodules
def prepareSubModules():
print("Initializing submodules for PySide2 version %s" % __version__)
diff --git a/testrunner.py b/testrunner.py
index 96d9139a3..096457e81 100644
--- a/testrunner.py
+++ b/testrunner.py
@@ -38,6 +38,7 @@
#############################################################################
from __future__ import print_function
+from utils import detectClang
"""
testrunner
@@ -99,6 +100,16 @@ script_dir = os.getcwd()
LogEntry = namedtuple("LogEntry", ["log_dir", "build_dir"])
+def setupClang():
+ if sys.platform != "win32":
+ return
+ clangDir = detectClang()
+ if clangDir[0]:
+ clangBinDir = os.path.join(clangDir[0], 'bin')
+ path = os.environ.get('PATH')
+ if not clangBinDir in path:
+ os.environ['PATH'] = clangBinDir + os.pathsep + path
+ print("Adding %s as detected by %s to PATH" % (clangBinDir, clangDir[1]))
class BuildLog(object):
"""
@@ -773,6 +784,8 @@ if __name__ == '__main__':
q = 5 * [0]
+ setupClang()
+
# now loop over the projects and accumulate
for project in args.projects:
runner = TestRunner(builds.selected, project)
diff --git a/utils.py b/utils.py
index 3de8fa7f8..568d06712 100644
--- a/utils.py
+++ b/utils.py
@@ -640,3 +640,21 @@ def osx_localize_libpaths(libpath, local_libs, enc_path=None):
if need_rpath and enc_path not in osx_get_rpaths(libpath):
back_tick('install_name_tool -add_rpath {epa} {lipa}'.format(
epa=enc_path, lipa=libpath ))
+
+# Add Clang to path for Windows for the shiboken ApiExtractor tests.
+# Revisit once Clang is bundled with Qt.
+def detectClang():
+ source = 'LLVM_INSTALL_DIR'
+ clangDir = os.environ.get(source, None)
+ if not clangDir:
+ source = 'CLANG_INSTALL_DIR'
+ clangDir = os.environ.get(source, None)
+ if not clangDir:
+ source = 'llvm-config'
+ try:
+ output = run_process_output([source, '--prefix'])
+ if output:
+ clangDir = output[0]
+ except OSError:
+ pass
+ return (clangDir, source)