Skip to content

Commit 09de17a

Browse files
chirontttonsky
authored andcommitted
support build for Windows Arm64
1 parent 1ca2749 commit 09de17a

3 files changed

Lines changed: 29 additions & 9 deletions

File tree

.github/workflows/build.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,32 +79,38 @@ jobs:
7979
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8080

8181
windows:
82-
runs-on: windows-latest
8382
strategy:
8483
matrix:
85-
build_type: [Release, Debug]
84+
os: [ windows-latest, windows-11-arm ]
85+
build_type: [ Release, Debug ]
8686
fail-fast: false
87+
runs-on: ${{ matrix.os }}
8788
steps:
88-
- uses: actions/checkout@v4
89+
- uses: actions/checkout@v6
8990
- shell: bash
9091
run: python3 script/check_release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }}
9192
if: ${{ github.event.inputs.skip_release != 'true' }}
9293
env:
9394
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
- uses: abdes/gha-setup-ninja@660f330a40aefa8d11632b3f901e92a4adb33d65
95-
- uses: microsoft/setup-msbuild@v1
95+
- run: |
96+
ninja --version
97+
$os_arch = "${{ runner.arch }}".ToLower()
98+
echo "os_arch=$os_arch" >> $env:GITHUB_ENV
99+
- uses: microsoft/setup-msbuild@v3
100+
with:
101+
msbuild-architecture: ${{ env.os_arch }}
96102
- uses: ilammy/msvc-dev-cmd@v1
97103
with:
98-
arch: amd64
104+
arch: ${{ env.os_arch }}
99105
- shell: bash
100106
run: python3 script/checkout.py --version ${{ env.version }}
101107
- shell: bash
102108
run: python3 script/build.py --build-type ${{ matrix.build_type }}
103109
- shell: bash
104110
run: python3 script/archive.py --version ${{ env.version }} --build-type ${{ matrix.build_type }}
105-
- uses: actions/upload-artifact@v4
111+
- uses: actions/upload-artifact@v7
106112
with:
107-
name: Skia-${{ env.version }}-windows-${{ matrix.build_type }}-x64.zip
113+
name: Skia-${{ env.version }}-windows-${{ matrix.build_type }}-${{ env.os_arch }}.zip
108114
path: '*.zip'
109115
- shell: bash
110116
run: python3 script/release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/bin/fetch-gn b/bin/fetch-gn
2+
index ebdc31c449..c727f342b6 100755
3+
--- a/bin/fetch-gn
4+
+++ b/bin/fetch-gn
5+
@@ -21,6 +21,9 @@ gnzip = os.path.join(tempfile.mkdtemp(), 'gn.zip')
6+
with open(gnzip, 'wb') as f:
7+
OS = {'darwin': 'mac', 'linux': 'linux', 'linux2': 'linux', 'win32': 'windows'}[sys.platform]
8+
cpu = {'aarch64': 'arm64', 'amd64': 'amd64', 'arm64': 'arm64', 'x86_64': 'amd64'}[platform.machine().lower()]
9+
+ if (OS == 'windows') and (cpu == 'arm64'):
10+
+ # for Windows Arm64, force the use of the amd64 gn binary
11+
+ cpu = 'amd64'
12+
13+
rev = 'b2afae122eeb6ce09c52d63f67dc53fc517dbdc8'
14+
url = 'https://chrome-infra-packages.appspot.com/dl/gn/gn/{}-{}/+/git_revision:{}'.format(

script/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def system():
2020
return args.system if args.system else {'Darwin': 'macos', 'Linux': 'linux', 'Windows': 'windows'}[platform.system()]
2121

2222
def native_machine():
23-
return {'AMD64': 'x64', 'x86_64': 'x64', 'arm64': 'arm64'}[platform.machine()]
23+
return {'amd64': 'x64', 'x86_64': 'x64', 'arm64': 'arm64'}[platform.machine().lower()]
2424

2525
def machine():
2626
parser = create_parser()

0 commit comments

Comments
 (0)