From 89f816958c265bf5c0e6bda90b83b909c866fcfe Mon Sep 17 00:00:00 2001 From: Garrett Barter Date: Sun, 7 Jan 2024 10:36:41 -0700 Subject: [PATCH] try this one --- setup.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index a6388d8..5349322 100644 --- a/setup.py +++ b/setup.py @@ -22,13 +22,13 @@ def has_ext_modules(foo): return True ####### this_dir = os.path.abspath(os.path.dirname(__file__)) +staging_dir = os.path.join(this_dir, "meson_build") build_dir = os.path.join(this_dir, "build") def copy_shared_libraries(): build_path = os.path.join(build_dir, "pyhams") for root, _dirs, files in os.walk(build_path): for file in files: - # move pyhams libraries to just under staging_dir if file.endswith((".so", ".lib", ".pyd", ".pdb", ".dylib", ".dll")): if ".so.p" in root or ".pyd.p" in root: # excludes intermediate object files continue @@ -80,19 +80,23 @@ def build_extension(self, ext): os.environ["CC"] = "gcc" purelibdir = "." - configure_call = ["meson", "setup", build_dir, "--wipe", + configure_call = ["meson", "setup", staging_dir, "--wipe", f"-Dpython.purelibdir={purelibdir}", f"--prefix={build_dir}", f"-Dpython.platlibdir={purelibdir}"] + meson_args.split() configure_call = [m for m in configure_call if m.strip() != ""] print(configure_call) - build_call = ["meson", "compile", "-vC", build_dir] + build_call = ["meson", "compile", "-vC", staging_dir] print(build_call) + install_call = ["meson", "install", "-C", staging_dir] + print(install_call) + self.build_temp = build_dir self.spawn(configure_call) self.spawn(build_call) + self.spawn(install_call) copy_shared_libraries()