1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
From: Ole Streicher <olebole@debian.org>
Date: Sun, 7 Aug 2022 19:51:08 +0200
Subject: Use precompiled libsep library instead of recompiling again
---
setup.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 2da55fa..6296a2a 100755
--- a/setup.py
+++ b/setup.py
@@ -37,6 +37,9 @@ is_non_build = (
or sys.argv[1] in ("egg_info", "clean", "help")
)
+# Get the path where the lib was built (to link with the proper libsep library)
+sep_lib_path = os.environ.get('SEP_LIB_PATH', '')
+
# extension module(s): only add if we actually need to build, because we need
# to import numpy and cython to build, and we'd rather non-build commands
# work when those dependencies are not installed.
@@ -46,7 +49,7 @@ else:
import numpy
from Cython.Build import cythonize
- sourcefiles = ["sep.pyx"] + glob(os.path.join("src", "*.c"))
+ sourcefiles = ["sep.pyx"]
headerfiles = glob(os.path.join("src", "*.h"))
include_dirs = [numpy.get_include(), "src"]
extensions = [
@@ -54,6 +57,8 @@ else:
"sep",
sourcefiles,
include_dirs=include_dirs,
+ libraries=["sep"],
+ library_dirs=[sep_lib_path],
depends=headerfiles,
define_macros=[
("_USE_MATH_DEFINES", "1"),
|