Skip to content

Commit

Permalink
Fix static linking on Windows (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Oct 11, 2021
1 parent cb395c5 commit 516b5bb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@ jobs:
include:
- target: x86_64-apple-darwin
os: macos-latest
rustflags: --deny warnings
- target: x86_64-pc-windows-msvc
os: windows-latest
rustflags: --deny warnings --codegen=target-feature=+crt-static
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
rustflags: --deny warnings

runs-on: ${{ matrix.os }}

env:
RUSTFLAGS: "--deny warnings"
RUSTFLAGS: ${{ matrix.rustflags }}

steps:
- uses: actions/checkout@v2
Expand Down
15 changes: 5 additions & 10 deletions bin/package
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@ BIN=agora
echo "Packaging $BIN $VERSION for $TARGET..."

echo "Building $BIN..."
cargo build --bin $BIN --target $TARGET --release
EXECUTABLE=target/$TARGET/release/$BIN

case $OS in
ubuntu-latest | macos-latest)
cargo build --bin $BIN --target $TARGET --release
EXECUTABLE=target/$TARGET/release/$BIN
;;
windows-latest)
cargo rustc --bin $BIN --target $TARGET --release -- --codegen target-feature="+crt-static"
EXECUTABLE=target/$TARGET/release/$BIN.exe
;;
esac
if [[ $OS == windows-latest ]]; then
EXECUTABLE=$EXECUTABLE.exe
fi

echo "Copying release files..."
mkdir dist
Expand Down

0 comments on commit 516b5bb

Please sign in to comment.