Skip to content

Commit

Permalink
Start work on MacOS x86 + arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
Rongmario committed Feb 11, 2024
1 parent 76527b0 commit 5636b92
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ jobs:
path: output/

mac_os_compile:
strategy:
matrix:
arch: [[x86_x64, x64], [i386, x86], [arm64, arm64]]
runs-on: macos-latest
steps:
- name: Checkout Repository
Expand All @@ -86,10 +89,10 @@ jobs:
java-version: '17'

- name: Compile
run: gcc -c -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/darwin ${{ env.PATH_TO_CODE }}.c -o ${{ env.PATH_TO_CODE }}_x64.o
run: gcc -c -arch ${{ matrix.arch[0] }} -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/darwin ${{ env.PATH_TO_CODE }}.c -o ${{ env.PATH_TO_CODE }}_${{ matrix.arch[1] }}.o

- name: Link
run: gcc -dynamiclib -o output/${{ env.LIB_NAME }}_x64.dylib ${{ env.PATH_TO_CODE }}_x64.o -lc
run: gcc -dynamiclib -o output/${{ env.LIB_NAME }}_${{ matrix.arch[1] }}.dylib ${{ env.PATH_TO_CODE }}_${{ matrix.arch[1] }}.o -lc

- name: Upload Natives
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 5636b92

Please sign in to comment.