-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows build with clang-cl; CI for Windows/ARM64 build (#1538)
## Issues Needed for: aws/aws-lc-rs#376 ## Description * Updated `CMakeLists.txt` to support a Windows build using `clang-cl`. * Adds CI build/test of Windows/x64 using clang-cl. * Adds CI build of Windows/ARM64 using clang-cl. (Currently there are no runners available for testing Windows/ARM64 executables.) ## Callout * This change removes debug information by default from the "Release" build type. Alternatively, one may retain debug information in the artifacts by adding the `-ggdb` build flag via **CMAKE_C_FLAGS** or by using the "Relwithdebinfo" or "Debug" build types. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
- Loading branch information
Showing
2 changed files
with
74 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,12 +63,64 @@ jobs: | |
options: | | ||
CMAKE_SYSTEM_NAME=Windows \ | ||
CMAKE_SYSTEM_PROCESSOR=x86_64 \ | ||
CMAKE_BUILD_TOOL=ninja.exe \ | ||
CMAKE_MAKE_PROGRAM=ninja.exe \ | ||
CMAKE_BUILD_TYPE=Release \ | ||
- name: Build Project | ||
run: cmake --build ./build --target all | ||
- name: Run tests | ||
run: cmake --build ./build --target run_tests | ||
clang-cl: | ||
if: github.repository_owner == 'aws' | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- x64 | ||
- x64_arm64 | ||
runs-on: windows-latest | ||
steps: | ||
- if: ${{ matrix.target == 'x64' }} | ||
name: Install NASM | ||
uses: ilammy/[email protected] | ||
- name: Remove wrong clang-cl.exe | ||
run: rm "C:/Program Files/LLVM/bin/clang-cl.exe" | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: TheMrMilchmann/setup-msvc-dev@v3 | ||
with: | ||
arch: ${{ matrix.target }} | ||
- if: ${{ matrix.target == 'x64' }} | ||
name: Setup CMake | ||
uses: threeal/[email protected] | ||
with: | ||
generator: Ninja | ||
c-compiler: clang-cl | ||
cxx-compiler: clang-cl | ||
options: | | ||
CMAKE_CROSSCOMPILING=${{ ((matrix.target == 'x64') && '0') || '1' }} \ | ||
CMAKE_SYSTEM_NAME=Windows \ | ||
CMAKE_SYSTEM_PROCESSOR=x86_64 \ | ||
CMAKE_BUILD_TYPE=Release \ | ||
- if: ${{ matrix.target == 'x64_arm64' }} | ||
name: Setup CMake | ||
uses: threeal/[email protected] | ||
with: | ||
generator: Ninja | ||
c-compiler: clang-cl | ||
cxx-compiler: clang-cl | ||
options: | | ||
CMAKE_CROSSCOMPILING=1 \ | ||
CMAKE_SYSTEM_NAME=Windows \ | ||
CMAKE_SYSTEM_PROCESSOR=ARM64 \ | ||
CMAKE_C_COMPILER_TARGET=arm64-pc-windows-msvc \ | ||
CMAKE_ASM_COMPILER_TARGET=arm64-pc-windows-msvc \ | ||
CMAKE_CXX_COMPILER_TARGET=arm64-pc-windows-msvc \ | ||
CMAKE_BUILD_TYPE=Release \ | ||
- name: Build Project | ||
run: cmake --build ./build --target all | ||
- if: ${{ matrix.target == 'x64' }} | ||
name: Run tests | ||
run: cmake --build ./build --target run_tests | ||
cross-mingw: | ||
if: github.repository_owner == 'aws' | ||
runs-on: ubuntu-22.04 | ||
|
@@ -95,4 +147,3 @@ jobs: | |
- name: x86_64-w64-mingw32 Build/Test | ||
run: | ||
./tests/ci/run_cross_mingw_tests.sh x86_64 w64-mingw32 "-DCMAKE_BUILD_TYPE=Release" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters