From 5636b92cb6df891d9175a3f8ebc321b745b2311f Mon Sep 17 00:00:00 2001 From: Rongmario Date: Sun, 11 Feb 2024 01:32:58 +0000 Subject: [PATCH] Start work on MacOS x86 + arm64 --- .github/workflows/build.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e83dfe7..30a37a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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