Skip to content

Commit

Permalink
try fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnux committed Mar 12, 2022
1 parent 7114294 commit 2a4e956
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ env:
# paths to be preserved. Use "/" as a delimiter.
RELEASE_ADDS: README.md LICENSE

CARGO_TERM_COLOR: always

jobs:
build:
Expand All @@ -40,19 +41,6 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Install Rust (rustup)
run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
if: matrix.os != 'macos-latest'
shell: bash

- name: Install Rust (macos)
# As of 7.12.2019 rust is not installed on MacOS
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/software-installed-on-github-hosted-runners#macos-1015
run: |
curl https://sh.rustup.rs | sh -s -- -y
echo "##[add-path]$HOME/.cargo/bin"
if: matrix.os == 'macos-latest'

- name: Build
run: cargo build --verbose --release

Expand Down
5 changes: 4 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ fn main() {
.file("src/main.cpp")
.compile("foo");

println!("cargo:rustc-link-arg=foo.lib"); // vs2013可能需要这个,试了很多办法都失败
#[cfg(windows)]
{
println!("cargo:rustc-link-arg=foo.lib"); // vs2013可能需要这个,试了很多办法都失败
}
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=src/main");
}

0 comments on commit 2a4e956

Please sign in to comment.