From 2a4e9564cd815af97b1a04d59b975412f5e7014e Mon Sep 17 00:00:00 2001 From: lynnux Date: Sat, 12 Mar 2022 21:51:02 +0800 Subject: [PATCH] try fix build --- .github/workflows/rust.yml | 14 +------------- build.rs | 5 ++++- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index be30260..4d80e06 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -17,6 +17,7 @@ env: # paths to be preserved. Use "/" as a delimiter. RELEASE_ADDS: README.md LICENSE + CARGO_TERM_COLOR: always jobs: build: @@ -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 diff --git a/build.rs b/build.rs index e5118e8..5f0a39f 100644 --- a/build.rs +++ b/build.rs @@ -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"); }