Skip to content

Commit

Permalink
Strip shared library on install for cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Luthaf committed May 23, 2023
1 parent 78f839b commit 6bb9bb3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ requires = [
"setuptools >=44",
"wheel >=0.36",
"cmake",
"ninja",
]
build-backend = "setuptools.build_meta"

Expand Down
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
)

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6bb9bb3

Please sign in to comment.