Skip to content

Commit

Permalink
Windows treat link warnings as error
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Jul 1, 2024
1 parent cc75014 commit 37884d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ jobs:
cargo-xwin:
if: github.repository_owner == 'aws'
runs-on: ubuntu-latest
env:
RUSTFLAGS: '-Clink-arg=/WX'
steps:
- name: Install build dependencies
run: |
Expand All @@ -142,6 +144,8 @@ jobs:
if: github.repository_owner == 'aws'
name: ${{ matrix.target }}
runs-on: windows-latest
env:
RUSTFLAGS: '-Clink-arg=/WX'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -180,6 +184,8 @@ jobs:
if: github.repository_owner == 'aws'
name: aarch64-pc-windows-msvc
runs-on: windows-latest
env:
RUSTFLAGS: '-Clink-arg=/WX'
steps:
- uses: actions/checkout@v3
with:
Expand Down
8 changes: 5 additions & 3 deletions aws-lc-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,16 @@ impl CmakeBuilder {

fn get_cmake_config(&self) -> cmake::Config {
let mut cmake_cfg = cmake::Config::new(&self.manifest_dir);
// See issue: https://github.com/aws/aws-lc-rs/issues/453
cmake_cfg.static_crt(true);
if cargo_env("CARGO_ENCODED_RUSTFLAGS").contains("-Ctarget-feature=+crt-static") {
// See issue: https://github.com/aws/aws-lc-rs/issues/453
cmake_cfg.static_crt(true);
}
cmake_cfg
}

#[allow(clippy::too_many_lines)]
fn prepare_cmake_build(&self) -> cmake::Config {
let mut cmake_cfg = self.get_cmake_config();

if OutputLibType::default() == OutputLibType::Dynamic {
cmake_cfg.define("BUILD_SHARED_LIBS", "1");
} else {
Expand All @@ -91,6 +92,7 @@ impl CmakeBuilder {
cmake_cfg.define("CMAKE_BUILD_TYPE", "release");
}
} else if target_os() == "windows" {
// See issue: https://github.com/aws/aws-lc-rs/issues/453
cmake_cfg.define("CMAKE_BUILD_TYPE", "relwithdebinfo");
} else {
cmake_cfg.define("CMAKE_BUILD_TYPE", "debug");
Expand Down

0 comments on commit 37884d0

Please sign in to comment.