Skip to content

Commit

Permalink
Add Windows on ARM support
Browse files Browse the repository at this point in the history
  • Loading branch information
equeim committed Dec 16, 2024
1 parent 6605ca1 commit 7291710
Show file tree
Hide file tree
Showing 4 changed files with 380 additions and 309 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/build-windows-msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ on:

jobs:
build-windows-msvc:
strategy:
fail-fast: false
matrix:
include:
- msvc-arch: 'amd64'
cmake-preset-arch: 'x86_64'
- msvc-arch: 'amd64_arm64'
cmake-preset-arch: 'arm64'

runs-on: windows-latest

steps:
Expand All @@ -30,6 +39,8 @@ jobs:

- name: Set up MSVC environment
uses: equeim/action-setup-msvc-environment@v1
with:
arch: ${{ matrix.msvc-arch }}

- name: Upgrade LLVM
if: inputs.build-with-msvc-clang-toolchain == 'true'
Expand All @@ -42,19 +53,20 @@ jobs:
vcpkg-root: ${{ github.workspace }}\vcpkg
binary-cache-path: ${{ github.workspace }}\vcpkg_binary_cache
save-cache: ${{ github.event_name != 'pull_request' && inputs.build-with-msvc-clang-toolchain != 'true' }}
cache-key-tag: ${{ matrix.cmake-preset-arch }}

- name: Build Tremotesf with ${{ inputs.build-with-msvc-clang-toolchain == 'true' && 'MSVC + Clang' || 'MSVC' }} toolchain
- name: Build Tremotesf with ${{ inputs.build-with-msvc-clang-toolchain == 'true' && 'MSVC + Clang' || 'MSVC' }} toolchain for ${{ matrix.cmake-preset-arch }} architecture
id: build
uses: equeim/action-cmake-build@v10
with:
cmake-arguments: --preset ${{ inputs.build-with-msvc-clang-toolchain == 'true' && 'windows-msvc-clang-vcpkg' || 'windows-msvc-vcpkg' }} -D VCPKG_INSTALLED_DIR=${{ github.workspace }}/vcpkg_installed -D TREMOTESF_ASAN=${{ inputs.release-tag == '' && inputs.build-with-msvc-clang-toolchain == 'false' && 'ON' || 'OFF' }}
cmake-arguments: --preset ${{ inputs.build-with-msvc-clang-toolchain == 'true' && 'windows-${{matrix.cmake-preset-arch}}-msvc-clang-vcpkg' || 'windows-${{matrix.cmake-preset-arch}}-msvc-vcpkg' }} -D VCPKG_INSTALLED_DIR=${{ github.workspace }}/vcpkg_installed -D TREMOTESF_ASAN=${{ inputs.release-tag == '' && inputs.build-with-msvc-clang-toolchain == 'false' && 'ON' || 'OFF' }}
package: true

- name: Archive packages
if: inputs.release-tag == ''
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.build-with-msvc-clang-toolchain == 'true' && 'windows-msvc-clang-packages' || 'windows-msvc-packages' }}
name: ${{ inputs.build-with-msvc-clang-toolchain == 'true' && 'windows-${{matrix.cmake-preset-arch}}-msvc-clang-packages' || 'windows-${{matrix.cmake-preset-arch}}-msvc-packages' }}
retention-days: ${{ github.event_name == 'push' && 7 || 3 }}
path: |
${{ steps.build.outputs.build-directory }}\packaging\windows\*.zip
Expand All @@ -73,6 +85,6 @@ jobs:
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ inputs.build-with-msvc-clang-toolchain == 'true' && 'windows-msvc-clang-vcpkg-logs' || 'windows-msvc-vcpkg-logs' }}
name: ${{ inputs.build-with-msvc-clang-toolchain == 'true' && 'windows-${{matrix.cmake-preset-arch}}-msvc-clang-vcpkg-logs' || 'windows-${{matrix.cmake-preset-arch}}-msvc-vcpkg-logs' }}
retention-days: ${{ github.event_name == 'push' && 7 || 3 }}
path: ${{ env.VCPKG_ROOT }}\buildtrees\*\*.log
Loading

0 comments on commit 7291710

Please sign in to comment.