diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b9fc13e..5fd429c 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -34,6 +34,7 @@ jobs: CIBW_BUILD: cp39-* CIBW_SKIP: cp39-musllinux* *win32 CIBW_ARCHS_MACOS: x86_64 arm64 + CIBW_BEFORE_BUILD: rm -rf build - uses: actions/upload-artifact@v3 with: diff --git a/pyproject.toml b/pyproject.toml index 9116ed2..49248e4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ requires = [ "setuptools >=44", "wheel >=0.36", "cmake", + "ninja", ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 93563de..84a09c2 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,7 @@ def run(self): pass cmake_options = [ + "-GNinja", f"-DCMAKE_INSTALL_PREFIX={install_dir}", "-DCMAKE_BUILD_TYPE=Release", "-DBUILD_SHARED_LIBS=ON", @@ -75,7 +76,12 @@ def run(self): build_dir = os.path.join(ROOT, "build", "cmake-build") subprocess.run( - ["cmake", "--build", build_dir, "--target", "install"], + ["cmake", "--build", build_dir], + check=True, + ) + + subprocess.run( + ["cmake", "--install", build_dir, "--strip"], check=True, ) diff --git a/tox.ini b/tox.ini index 2ec8dfb..8c6c50c 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,7 @@ setenv = CHFL_PY_INTERNAL_CHEMFILES = 1 deps = wheel cmake + ninja commands = pip wheel . --no-build-isolation --verbose --no-deps --check-build-dependencies --wheel-dir {envtmpdir}/dist