Skip to content

Commit

Permalink
ci: build for macos and linux
Browse files Browse the repository at this point in the history
  • Loading branch information
xfoxfu committed Oct 19, 2023
1 parent 57ec7b7 commit ebc9012
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .cargo/config.toml
Expand Up @@ -9,3 +9,9 @@ rustflags = ["-C", "link-args=-weak_framework CoreHaptics"]

[target.aarch64-apple-darwin]
rustflags = ["-C", "link-args=-weak_framework CoreHaptics"]

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-args=-lz"]

[target.aarch64-unknown-linux-gnu]
rustflags = ["-C", "link-args=-lz"]
12 changes: 9 additions & 3 deletions .github/workflows/rust.yml
Expand Up @@ -27,15 +27,21 @@ jobs:
key: ${{ runner.os }}-target
- name: Install vcpkg
run: cargo install cargo-vcpkg
- name: Install Linux dependencies
run: |
sudo apt-get install -y libx11-dev libxft-dev libxext-dev
sudo apt-get install -y libwayland-dev libxkbcommon-dev libegl1-mesa-dev
sudo apt-get install -y libibus-1.0-dev
if: runner.os == 'Linux'
- name: Build
run: |
cargo vcpkg --verbose build --target i686-pc-windows-msvc
cargo build --verbose --release --target i686-pc-windows-msvc
cargo vcpkg --verbose build $TARGET
cargo build --verbose --release $TARGET
env:
VCPKG_ROOT: |-
${{ github.workspace }}${{
runner.os == 'Windows' && '\\target\\vcpkg' || '/target/vcpkg' }}
MACOSX_DEPLOYMENT_TARGET: 11.0
TARGET: ${{runner.os == 'Windows' && '--target i686-pc-windows-msvc' || '' }}
- name: Run tests
run: cargo test --verbose --release
- name: Upload Binary
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ebc9012

Please sign in to comment.