Skip to content

Commit

Permalink
try static link
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcb committed Feb 5, 2025
1 parent 6fe7bfa commit 503d007
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/build-all-gmp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build All GMP
on:
push:
branches:
- master
- gmp-macos-x64-static
paths:
- .github/workflows/build-all-gmp.yml
- .github/workflows/build-gmp.yml
Expand All @@ -25,26 +25,26 @@ jobs:
strategy:
matrix:
include:
- { os: linux, arch: x64 }
- { os: linux, arch: x86 }
- { os: linux, arch: arm64 }
- { os: linux, arch: arm }
- { os: linux-musl, arch: x64 }
- { os: linux-musl, arch: arm64 }
- { os: win, arch: x64 }
- { os: win, arch: x86 }
- { os: android, arch: x64 }
- { os: android, arch: arm64 }
- { os: android, arch: x86 }
- { os: android, arch: arm }
- { os: osx, arch: arm64 }
# - { os: linux, arch: x64 }
# - { os: linux, arch: x86 }
# - { os: linux, arch: arm64 }
# - { os: linux, arch: arm }
# - { os: linux-musl, arch: x64 }
# - { os: linux-musl, arch: arm64 }
# - { os: win, arch: x64 }
# - { os: win, arch: x86 }
# - { os: android, arch: x64 }
# - { os: android, arch: arm64 }
# - { os: android, arch: x86 }
# - { os: android, arch: arm }
# - { os: osx, arch: arm64 }
- { os: osx, arch: x64 }
- { os: ios, arch: arm64 }
- { os: browser, arch: wasm }
# - { os: ios, arch: arm64 }
# - { os: browser, arch: wasm }

uses: ./.github/workflows/build-gmp.yml
with:
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
gmp-version: ${{ github.event.inputs.gmp-version || '6.3.0' }}
build-type: ${{ github.event.inputs.build-type || 'shared' }}
build-type: ${{ github.event.inputs.build-type || 'static' }}
10 changes: 7 additions & 3 deletions .github/workflows/build-gmp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,15 @@ jobs:
- name: Compile Test C Program
run: |
if [ "$BUILD_TYPE" = "static" ]; then
LINK_OPTION="-lm ${{ github.workspace }}/gmp-${{ inputs.gmp-version }}/${{ env.GMP_SO }}"
else
LINK_OPTION="-L${{ github.workspace }}/gmp-${{ inputs.gmp-version }}/.libs -lgmp"
fi
${{ env.TEST_CC }} -o factorial_gmp.exe \
.github/workflows/factorial_gmp.c \
-I${{ github.workspace }}/gmp-${{ inputs.gmp-version }} \
-L${{ github.workspace }}/gmp-${{ inputs.gmp-version }}/.libs \
-lgmp
-I${{ github.workspace }}/gmp-${{ inputs.gmp-version }} $LINK_OPTION
ls -l
file factorial_gmp.exe
Expand Down

0 comments on commit 503d007

Please sign in to comment.