Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions folly/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
from Cython.Compiler import Options
from setuptools import Extension, setup

additional_libs = []
if sys.platform == 'darwin' and platform.machine() == 'arm64':
# Macos (arm64, homebrew path is different than intel)
library_dirs = ['/opt/homebrew/lib']
else:
# Debian/Ubuntu
library_dirs = ['/usr/lib', '/usr/lib/x86_64-linux-gnu']
additional_libs.extend(['unwind'])

# Add (prepend) library paths from CMAKE_PREFIX_PATH
if cmake_prefix_path := os.environ.get('CMAKE_PREFIX_PATH'):
Expand Down Expand Up @@ -56,7 +58,7 @@
'folly/ProactorExecutor.cpp',
'folly/error.cpp',
],
libraries=['folly', 'unwind', 'glog', 'double-conversion','fmt'],
libraries=['folly', 'glog', 'double-conversion','fmt'] + additional_libs,
extra_compile_args=['-std=c++20'], # C++20 for coroutines
include_dirs=['.', '../..'], # cython generated code
library_dirs=library_dirs,
Expand All @@ -69,7 +71,7 @@
'folly/iobuf_ext.cpp',
'folly/error.cpp',
],
libraries=['folly', 'unwind', 'glog', 'double-conversion', 'fmt'],
libraries=['folly', 'glog', 'double-conversion', 'fmt'] + additional_libs,
extra_compile_args=['-std=c++20'], # C++20 for coroutines
include_dirs=['.', '../..'], # cython generated code
library_dirs=library_dirs,
Expand All @@ -81,8 +83,8 @@
'folly/fibers.cpp',
'folly/error.cpp',
],
libraries=['folly', 'unwind', 'boost_coroutine', 'boost_context',
'glog', 'double-conversion', 'fmt', 'event'],
libraries=['folly', 'boost_coroutine', 'boost_context',
'glog', 'double-conversion', 'fmt', 'event'] + additional_libs,
extra_compile_args=['-std=c++20'], # C++20 for coroutines
include_dirs=['.', '../..'], # cython generated code
library_dirs=library_dirs,
Expand All @@ -98,4 +100,4 @@
zip_safe=False,
package_data={'': ['*.pxd', '*.pyi', '*.h', '__init__.py']},
ext_modules=cythonize(exts, compiler_directives={'language_level': 3}),
)
)