diff --git a/setup.py b/setup.py index ff198c6..d898a50 100644 --- a/setup.py +++ b/setup.py @@ -59,6 +59,13 @@ def get_swigdir(): # need iconv too but without proper -L adding -liconv here won't always work libs = [] +if sys.platform.startswith("darwin"): + # On recent macos versions (mojave) it is necessary to specify that libc++ is used instead of libstdc++. + # Furthermore, '-Wl,-undefined,dynamic_lookup' is necessary to link the right libraries. + libs += ["-stdlib=libc++", '-Wl,-undefined,dynamic_lookup'] + extra_compile_args = ["-stdlib=libc++"] + + simstring_module = Extension( '_simstring', sources = [