Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows treat link warnings as error
Browse files Browse the repository at this point in the history
justsmth committed Jul 1, 2024
1 parent cc75014 commit 7a8297e
Showing 2 changed files with 10 additions and 16 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
@@ -148,18 +148,10 @@ jobs:
target:
- 'x86_64-pc-windows-gnu'
- 'i686-pc-windows-msvc'
# TODO: The build for 'i686-pc-windows-gnu' succeeds locally.
# GH CI erroring with `undefined reference` to several assembly functions.
# Verify NASM setup and symbol prefixing are working as expected.
# - 'i686-pc-windows-gnu'
# TODO: 'i686-pc-windows-gnu'
env:
RUSTFLAGS: '-Clink-arg=/WX'
steps:
- if: ${{ matrix.target == 'i686-pc-windows-gnu' }}
name: Set up MinGW
shell: bash
run: |
choco install mingw --x86
echo "C:/ProgramData/mingw64/mingw32/bin/" >> "$GITHUB_PATH"
echo "export COMPILER_PATH=C:/ProgramData/mingw64/mingw32/bin/" >> "$GITHUB_ENV"
- uses: ilammy/setup-nasm@v1
- uses: actions/checkout@v3
with:
@@ -170,16 +162,16 @@ jobs:
toolchain: stable
target: ${{ matrix.target }}
- name: Debug Test on `${{ matrix.target }}`
shell: bash
run: cargo test -p aws-lc-rs --target ${{ matrix.target }} --features bindgen
- name: Release test on `${{ matrix.target }}`
shell: bash
run: cargo test -p aws-lc-rs --release --target ${{ matrix.target }} --features bindgen

aws-lc-rs-windows-arm64:
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:
8 changes: 5 additions & 3 deletions aws-lc-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
@@ -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 {
@@ -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");

0 comments on commit 7a8297e

Please sign in to comment.