Skip to content

Commit 9c3f968

Browse files
authored
ci: setup vcpkg env properly (#44)
Signed-off-by: msclock <[email protected]>
1 parent 3cbf9ac commit 9c3f968

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

.github/workflows/cd.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,6 @@ jobs:
7272
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
7373
if: runner.os == 'Linux' && contains(matrix.use_qemu, matrix.arch)
7474

75-
- name: Check architecture and set environment variable
76-
if: runner.os == 'Linux'
77-
run: |
78-
echo "Checking architecture..."
79-
if [[ ${{ matrix.arch }} == "aarch64" ||
80-
${{ matrix.arch }} == "ppc64le" ||
81-
${{ matrix.arch }} == "s390x" ||
82-
${{ matrix.arch }} == *"arm"* ]]; then
83-
echo "Set VCPKG_FORCE_SYSTEM_BINARIES=1"
84-
echo "CIBW_ENVIRONMENT=VCPKG_FORCE_SYSTEM_BINARIES=1" >> $GITHUB_ENV
85-
fi
86-
8775
- name: Build wheels
8876
uses: pypa/cibuildwheel@ee63bf16da6cddfb925f542f2c7b59ad50e93969 # v2.22.0
8977
env:

pyproject.toml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ name = "cppcheck"
77
description = "Package cppcheck as a python wheel."
88
readme = "README.md"
99
license = { text = "Apache-2.0" }
10-
authors = [
11-
{ email = "[email protected]", name = "msclock" },
12-
]
10+
authors = [{ email = "[email protected]", name = "msclock" }]
1311
requires-python = ">=3.7"
1412
classifiers = [
1513
"Intended Audience :: Science/Research",
@@ -66,10 +64,10 @@ metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
6664
sdist.include = ["src/cppcheck/_version.py"]
6765
cmake.args = [
6866
"-DBUILD_TESTING=OFF",
69-
"-DCMAKE_BUILD_TYPE=ReWithDebInfo", # Required RelWithDebInfo or Release
67+
"-DCMAKE_BUILD_TYPE=ReWithDebInfo", # Required RelWithDebInfo or Release
7068
"-DCMAKE_TOOLCHAIN_FILE=cmake/vcpkg/vcpkg.toolchain.cmake",
7169
"-DVCPKG_OVERLAY_TRIPLETS=cmake/vcpkg/triplets",
72-
"-DVCPKG_OVERLAY_PORTS=cmake/vcpkg/ports"
70+
"-DVCPKG_OVERLAY_PORTS=cmake/vcpkg/ports",
7371
]
7472

7573
[tool.setuptools_scm]
@@ -82,13 +80,19 @@ test-extras = ["test"]
8280
test-skip = ["*-win_arm64", "*-macosx_universal2:arm64"]
8381

8482
[tool.cibuildwheel.linux]
85-
before-build =[
83+
before-build = [
8684
'yum install zip -y || apk add zip || true',
8785
'apt update && apt install zip pkg-config -y || true',
8886
'pip install cmake ninja',
89-
'cmake --version', 'git --version', 'ninja --version',
87+
'cmake --version',
88+
'git --version',
89+
'ninja --version',
9090
]
9191

92+
[[tool.cibuildwheel.overrides]]
93+
select = "*linux_{aarch64,armv7l,ppc64le,s390x}"
94+
environment = { VCPKG_FORCE_SYSTEM_BINARIES = "1" }
95+
9296
[tool.pytest.ini_options]
9397
minversion = "6.0"
9498
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]

0 commit comments

Comments
 (0)