mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-02-04 14:33:21 +08:00
find library path to libclang.so via glob command in /usr/lib/llvm-* and set it
This commit is contained in:
parent
9ed8b44033
commit
00c462d149
@ -254,6 +254,13 @@ def read_args(args):
|
|||||||
parameters.append('-isysroot')
|
parameters.append('-isysroot')
|
||||||
parameters.append(sysroot_dir)
|
parameters.append(sysroot_dir)
|
||||||
elif platform.system() == 'Linux':
|
elif platform.system() == 'Linux':
|
||||||
|
# cython.util.find_library does not find `libclang` for all clang
|
||||||
|
# versions and distributions. LLVM switched to a monolithical setup
|
||||||
|
# that includes everything under /usr/lib/llvm{version_number}/
|
||||||
|
# We therefore glob for the library and select the highest version
|
||||||
|
library_path = sorted(glob("/usr/lib/llvm-*/lib/"), reversed=True)[0]
|
||||||
|
cindex.Config.set_library_path(library_path)
|
||||||
|
|
||||||
# clang doesn't find its own base includes by default on Linux,
|
# clang doesn't find its own base includes by default on Linux,
|
||||||
# but different distros install them in different paths.
|
# but different distros install them in different paths.
|
||||||
# Try to autodetect, preferring the highest numbered version.
|
# Try to autodetect, preferring the highest numbered version.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user