pybind11: hack to set library directory (won't work with nix)
This commit is contained in:
parent
bfc7828b0a
commit
8247f9b56f
1 changed files with 18 additions and 2 deletions
|
|
@ -284,8 +284,24 @@ macro(xo_pybind11_link_flags)
|
|||
set_property(
|
||||
TARGET pybind11::python_link_helper
|
||||
APPEND
|
||||
PROPERTY INTERFACE_LINK_OPTIONS "$<$<PLATFORM_ID:Darwin>:LINKER:-flat_namespace>"
|
||||
)
|
||||
PROPERTY
|
||||
INTERFACE_LINK_OPTIONS "$<$<PLATFORM_ID:Darwin>:LINKER:-flat_namespace>")
|
||||
|
||||
# looks like pybind11_add_module() tries to link transitive deps
|
||||
# of libs mentioned in xo_dependency() -- perhaps for link-time optimization?
|
||||
#
|
||||
# For example when linking libpyreflect, get link line with -lrefcnt
|
||||
# (presumably since cmake knows that libreflect.so depends on librefcnt.so);
|
||||
# this triggers error, since link doesn't know where to find librefcnt.so
|
||||
#
|
||||
# To workaround, add ${CMAKE_INSTALL_PREFIX}/lib to the link line.
|
||||
#
|
||||
# WARNING: expect this not to work in a hermetic nix build!
|
||||
#
|
||||
set_property(TARGET pybind11::python_link_helper
|
||||
APPEND
|
||||
PROPERTY
|
||||
INTERFACE_LINK_OPTIONS "-L${CMAKE_INSTALL_PREFIX}/lib")
|
||||
endmacro()
|
||||
|
||||
# ----------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue