Skip to content

Commit

Permalink
Test more windows targets
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Jun 28, 2024
1 parent 5b24c1a commit 7022c42
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,22 @@ jobs:
- name: cargo xwin build for `aarch64-pc-windows-msvc`
run: cargo xwin build -p aws-lc-rs --release --target aarch64-pc-windows-msvc

aws-lc-rs-windows-mingw:
aws-lc-rs-windows-cross:
if: github.repository_owner == 'aws'
name: x86_64-pc-windows-gnu
name: ${{ matrix.target }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
target: [ 'x86_64-pc-windows-gnu', 'i686-pc-windows-msvc', 'i686-pc-windows-gnu' ]
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:
Expand All @@ -151,11 +162,13 @@ jobs:
id: toolchain
with:
toolchain: stable
target: x86_64-pc-windows-gnu
- name: Debug Test on `x86_64-pc-windows-gnu`
run: cargo test -p aws-lc-rs --target x86_64-pc-windows-gnu --features bindgen
- name: Release test on `x86_64-pc-windows-gnu`
run: cargo test -p aws-lc-rs --release --target x86_64-pc-windows-gnu --features bindgen
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'
Expand Down
15 changes: 10 additions & 5 deletions aws-lc-sys/builder/cmake_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ impl CmakeBuilder {
return cmake_cfg;
}

if test_ninja_command() {
// Use Ninja if available
cmake_cfg.generator("Ninja");
}

if target_os() == "windows" && target_arch() == "x86" && target_env() == "msvc" {
cmake_cfg.define("CMAKE_SYSTEM_NAME", "");
cmake_cfg.define("CMAKE_SYSTEM_PROCESSOR", "");
}

if target_vendor() == "apple" {
if target_os().to_lowercase() == "ios" {
cmake_cfg.define("CMAKE_SYSTEM_NAME", "iOS");
Expand All @@ -154,11 +164,6 @@ impl CmakeBuilder {
}
}

if (target_env() != "msvc") && test_ninja_command() {
// Use Ninja if available
cmake_cfg.generator("Ninja");
}

if target_underscored() == "aarch64_pc_windows_msvc" {
cmake_cfg.generator("Ninja");
cmake_cfg.define("CMAKE_C_COMPILER", "clang-cl");
Expand Down

0 comments on commit 7022c42

Please sign in to comment.