Skip to content

Commit

Permalink
Build bluemonday.so using GOARCH to build an arm64 so (#42)
Browse files Browse the repository at this point in the history
* Build x86_64 and arm64 wheels seperately on MacOS
* Set `CGO_ENABLED` and `GOARCH` for arm64 MacOS wheels
  • Loading branch information
ColdHeat committed Jul 18, 2023
1 parent 150a40b commit ea7a90f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,23 @@ jobs:
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build macOS wheels
- name: Build x86_64 macOS wheels
if: runner.os == 'macOS'
env:
CIBW_SKIP: "cp35-* cp36-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_MACOS: x86_64
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- name: Build arm64 macOS wheels
if: runner.os == 'macOS'
env:
CIBW_SKIP: "cp35-* cp36-* *-win32 *-manylinux_i686 *-manylinux_aarch64 *-manylinux_ppc64le *-manylinux_s390x"
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS_MACOS: arm64
GOARCH: arm64
CGO_ENABLED: 1
run: |
python3 -m cibuildwheel --output-dir wheelhouse
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
so:
go get -d
ifndef GOARCH
go build -buildmode=c-shared -o bluemonday.so .
else
CGO_ENABLED=1 GOARCH=${GOARCH} go build -buildmode=c-shared -o bluemonday.so .
endif

ffi:
python3 build_ffi.py
Expand Down

0 comments on commit ea7a90f

Please sign in to comment.