aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@theqtcompany.com>2016-05-11 11:37:56 +0200
committerAlexandru Croitor <alexandru.croitor@theqtcompany.com>2016-05-11 13:36:04 +0000
commitcdbd5528625ea3b1fe429134013f7cc6dd18b41f (patch)
tree1abd6632481783329dc342bc1641974b1c996e4a /setup.py
parent5ce67f34294d07df45e4d84ece278e820874461c (diff)
Add option to link with libc++ on older OSX versions.
Versions of OSX lower than 10.9 link libstdc++ by default. Also libstdc++ is linked when the osx minimum deployment target is lower than 10.9. The new option allows explicitly linking libc++ in the cases mentioned above. It is not enabled by default, because most libraries and executables on versions lower than 10.9 are compiled with libstdc++, and mixing standard library versions can lead to crashes. Change-Id: I7397d2bbce2cfceaeb848f25e0bbf1a24ac9bde8 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index b7cd3fb9c..236d9f1e8 100644
--- a/setup.py
+++ b/setup.py
@@ -160,6 +160,7 @@ OPTION_JOBS = option_value('jobs') # number of parallel build job
OPTION_JOM = has_option('jom') # use jom instead of nmake with msvc
OPTION_BUILDTESTS = has_option("build-tests")
OPTION_OSXARCH = option_value("osx-arch")
+OPTION_OSX_USE_LIBCPP = has_option("osx-use-libc++")
OPTION_XVFB = has_option("use-xvfb")
if OPTION_QT_VERSION is None:
@@ -634,6 +635,15 @@ class pyside_build(_build):
# also tell cmake which architecture to use
cmake_cmd.append("-DCMAKE_OSX_ARCHITECTURES:STRING={}".format(OPTION_OSXARCH))
+ if OPTION_OSX_USE_LIBCPP:
+ # Explicitly link the libc++ standard library (useful for osx deployment targets
+ # lower than 10.9). This is not on by default, because most libraries and
+ # executables on OSX <= 10.8 are linked to libstdc++, and mixing standard libraries
+ # can lead to crashes.
+ # On OSX >= 10.9 with a similar minimum deployment target, libc++ is linked in
+ # implicitly, thus the option is a no-op in those cases.
+ cmake_cmd.append("-DOSX_USE_LIBCPP=ON")
+
log.info("Configuring module %s (%s)..." % (extension, module_src_dir))
if run_process(cmake_cmd) != 0:
raise DistutilsSetupError("Error configuring " + extension)