Skip to content

Commit

Permalink
build scripts: simplify output directory handling
Browse files Browse the repository at this point in the history
Note: the scripts still work on 32-bit!
  • Loading branch information
supermihi committed Mar 16, 2024
1 parent 5a26133 commit ae8a195
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 3 additions & 6 deletions build_taglib.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
from argparse import ArgumentParser
from pathlib import Path

is_x64 = sys.maxsize > 2 ** 32
arch = "x64" if is_x64 else "x32"
system = platform.system()
python_version = platform.python_version()
python_implementation = sys.implementation.name
Expand All @@ -27,7 +25,7 @@
class Configuration:
def __init__(self):
self.build_path = here / "build"
self.tl_install_dir = self.build_path / "taglib" / f"{system}-{arch}-{python_implementation}-{python_version}"
self.tl_install_dir = self.build_path / "taglib" / f"{system}-{python_implementation}-{python_version}"
self.clean = False

@property
Expand Down Expand Up @@ -116,8 +114,7 @@ def cmake_config(config: Configuration):
print("running cmake ...")
args = ["-DWITH_ZLIB=OFF"] # todo fix building wheels with zlib support
if system == "Windows":
cmake_arch = "x64" if is_x64 else "Win32"
args += ["-A", cmake_arch]
args += ["-A", "x64"]
elif system == "Linux":
args.append("-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
args.append(f"-DCMAKE_INSTALL_PREFIX={config.tl_install_dir}")
Expand Down Expand Up @@ -166,7 +163,7 @@ def parse_args() -> Configuration:


def run():
print(f"building taglib on {system}, arch {arch}, for python {python_version} ...")
print(f"building taglib on {system}, for {python_implementation} {python_version} ...")
config = parse_args()
tag_lib = (
config.tl_install_dir
Expand Down
4 changes: 1 addition & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
from Cython.Build import cythonize
from setuptools import setup, Extension

is_x64 = sys.maxsize > 2 ** 32
arch = "x64" if is_x64 else "x32"
system = platform.system()
python_version = platform.python_version()
python_implementation = sys.implementation.name
here = Path(__file__).resolve().parent
default_taglib_path = here / "build" / "taglib" / f"{system}-{arch}-{python_implementation}-{python_version}"
default_taglib_path = here / "build" / "taglib" / f"{system}-{python_implementation}-{python_version}"

src = Path("src")

Expand Down

0 comments on commit ae8a195

Please sign in to comment.