[mac/clang/libc++/c++11] force clang to use libc++ for c++11, instead of the default old libstdc++4.2.1 which doesn't support c++11
parent
a8d363c347
commit
90ea744619
|
|
@ -2,6 +2,12 @@ from distutils.core import setup
|
||||||
from distutils.extension import Extension
|
from distutils.extension import Extension
|
||||||
from Cython.Build import cythonize
|
from Cython.Build import cythonize
|
||||||
import eigency
|
import eigency
|
||||||
|
from sys import platform
|
||||||
|
|
||||||
|
# force clang use libc++ instead of the default libstdc++ shipped with MacOSX, which doesn't support c++11
|
||||||
|
libc_flag = []
|
||||||
|
if platform == "darwin":
|
||||||
|
libc_flag = ["-stdlib=libc++"]
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
ext_modules = cythonize(Extension(
|
ext_modules = cythonize(Extension(
|
||||||
|
|
@ -13,5 +19,6 @@ setup(
|
||||||
libraries = ['gtsam'],
|
libraries = ['gtsam'],
|
||||||
library_dirs = ["${CMAKE_BINARY_DIR}/gtsam"],
|
library_dirs = ["${CMAKE_BINARY_DIR}/gtsam"],
|
||||||
language="c++",
|
language="c++",
|
||||||
extra_compile_args=["-std=c++11"])),
|
extra_compile_args=["-std=c++11"] + libc_flag,
|
||||||
)
|
extra_link_args=libc_flag)),
|
||||||
|
)
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,10 @@ import sys
|
||||||
# so that it can find the wrapped gtsam package
|
# so that it can find the wrapped gtsam package
|
||||||
sys.path.append("..")
|
sys.path.append("..")
|
||||||
|
|
||||||
|
libc_flag = []
|
||||||
|
if sys.platform == "darwin":
|
||||||
|
libc_flag = ["-stdlib=libc++"]
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
ext_modules=cythonize(Extension(
|
ext_modules=cythonize(Extension(
|
||||||
"gtsam_unstable",
|
"gtsam_unstable",
|
||||||
|
|
@ -17,6 +21,7 @@ setup(
|
||||||
libraries=['gtsam', 'gtsam_unstable'],
|
libraries=['gtsam', 'gtsam_unstable'],
|
||||||
library_dirs=["${GTSAM_DIR}/../../"],
|
library_dirs=["${GTSAM_DIR}/../../"],
|
||||||
language="c++",
|
language="c++",
|
||||||
extra_compile_args=["-std=c++11"])),
|
extra_compile_args=["-std=c++11"] + libc_flag,
|
||||||
|
extra_link_args=libc_flag)),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue