Skip to content

Commit

Permalink
try this one
Browse files Browse the repository at this point in the history
  • Loading branch information
gbarter committed Jan 7, 2024
1 parent 134222f commit 89f8169
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()


Expand Down

0 comments on commit 89f8169

Please sign in to comment.