From 7a1a0fabdbff5bac8d4690fd87285103ab4a1de8 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 22 Mar 2023 09:41:51 +0000 Subject: [PATCH] Add support for Windows arm64 (#423) --- .github/workflows/build_and_test.yaml | 2 +- .github/workflows/build_windows.yaml | 10 ++++++++-- scripts/hak/target.ts | 9 +++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index 1836402..38ccfae 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -19,7 +19,7 @@ jobs: uses: ./.github/workflows/build_windows.yaml strategy: matrix: - arch: [x64, x86] + arch: [x64, x86, arm64] with: arch: ${{ matrix.arch }} diff --git a/.github/workflows/build_windows.yaml b/.github/workflows/build_windows.yaml index 8eebca4..7f7d638 100644 --- a/.github/workflows/build_windows.yaml +++ b/.github/workflows/build_windows.yaml @@ -14,7 +14,7 @@ on: arch: type: string required: true - description: "The architecture to build for, one of 'x64' | 'x86'" + description: "The architecture to build for, one of 'x64' | 'x86' | 'arm64'" version: type: string required: false @@ -45,6 +45,12 @@ jobs: "target": "x86_64-pc-windows-msvc", "dir": "x64" }, + "arm64": { + "target": "aarch64-pc-windows-msvc", + "build-args": "--arm64", + "arch": "amd64_arm64", + "dir": "arm64" + }, "x86": { "target": "i686-pc-windows-msvc", "build-args": "--ia32", @@ -69,7 +75,7 @@ jobs: - name: Set up build tools uses: ilammy/msvc-dev-cmd@v1 with: - arch: ${{ inputs.arch }} + arch: ${{ steps.config.outputs.arch || inputs.arch }} # ActiveTCL package on choco is from 2015, # this one is newer but includes more than we need diff --git a/scripts/hak/target.ts b/scripts/hak/target.ts index 2d0fa71..1670dd4 100644 --- a/scripts/hak/target.ts +++ b/scripts/hak/target.ts @@ -25,6 +25,7 @@ export type TargetId = | "universal-apple-darwin" | "i686-pc-windows-msvc" | "x86_64-pc-windows-msvc" + | "aarch64-pc-windows-msvc" | "i686-unknown-linux-musl" | "i686-unknown-linux-gnu" | "x86_64-unknown-linux-musl" @@ -98,6 +99,13 @@ const x8664PcWindowsMsvc: WindowsTarget = { vcVarsArch: "amd64", }; +const aarch64WindowsMsvc: WindowsTarget = { + id: 'aarch64-pc-windows-msvc', + platform: 'win32', + arch: 'arm64', + vcVarsArch: 'arm64', +}; + const x8664UnknownLinuxGnu: LinuxTarget = { id: "x86_64-unknown-linux-gnu", platform: "linux", @@ -162,6 +170,7 @@ export const TARGETS: Record = { // Windows "i686-pc-windows-msvc": i686PcWindowsMsvc, "x86_64-pc-windows-msvc": x8664PcWindowsMsvc, + 'aarch64-pc-windows-msvc': aarch64WindowsMsvc, // Linux "i686-unknown-linux-musl": i686UnknownLinuxMusl, "i686-unknown-linux-gnu": i686UnknownLinuxGnu,