From 2459ef4df9f1a667f89780132872933ec54da707 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Tue, 25 Sep 2018 19:50:44 +0200 Subject: [PATCH] Fix native_libs.txt When building additional, auxiliary libraries they should receive proper handling in "native_libs.txt". Surprisingly, this only happens when a trailing `/` is added. Also, the primary module will then go into the package directory. Additional `RPATH`/`RUNPATH` handling for auxiliary, "native" libs is likely needed. E.g. on Linux/OSX: ``` '-DCMAKE_INSTALL_RPATH=$ORIGIN', '-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON', '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF', ``` while on Windows one can just keep a flat structure in the package, which will be in `%PATH%`. --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index 7db697f..bd30b12 100644 --- a/setup.py +++ b/setup.py @@ -33,6 +33,10 @@ def run(self): def build_extension(self, ext): extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name))) + # required for auto-detection of auxiliary "native" libs + if not extdir.endswith(os.path.sep): + extdir += os.path.sep + cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir, '-DPYTHON_EXECUTABLE=' + sys.executable]