Skip to content

Commit 9b2b311

Browse files
committed
Build for ARM on Windows.
1 parent 5ab9da6 commit 9b2b311

4 files changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/build-natives.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,48 @@ jobs:
7272
name: Natives-Windows
7373
path: ./artifacts
7474

75+
windows-arm64:
76+
name: Windows (arm64)
77+
runs-on: windows-11-arm
78+
steps:
79+
- name: Clone repository
80+
uses: actions/checkout@v7
81+
82+
- name: Setup Dependencies
83+
shell: pwsh
84+
run: |
85+
New-Item -ItemType Directory -Force -Path artifacts/arm64 | Out-Null
86+
87+
- name: Compile natives
88+
shell: pwsh
89+
run: |
90+
$ErrorActionPreference = "Stop"
91+
92+
$zip = "${env:FREETYPE_VERSION}.zip"
93+
Invoke-WebRequest -Uri "https://github.com/freetype/freetype/archive/refs/tags/$zip" -OutFile $zip
94+
Expand-Archive -Path $zip -DestinationPath .
95+
96+
$src = "freetype-${env:FREETYPE_VERSION}"
97+
98+
cmake -S $src -B "$src\build-arm64" `
99+
-A ARM64 `
100+
-DBUILD_SHARED_LIBS=TRUE `
101+
-DCMAKE_BUILD_TYPE=Release `
102+
-DFT_DISABLE_ZLIB=TRUE `
103+
-DFT_DISABLE_BZIP2=TRUE `
104+
-DFT_DISABLE_PNG=TRUE `
105+
-DFT_DISABLE_HARFBUZZ=TRUE `
106+
-DFT_DISABLE_BROTLI=TRUE
107+
108+
cmake --build "$src\build-arm64" --config Release
109+
Copy-Item "$src\build-arm64\Release\freetype.dll" "artifacts\arm64\freetype6.dll" -Force
110+
111+
- name: Upload Artifacts
112+
uses: actions/upload-artifact@v7
113+
with:
114+
name: Natives-Windows(arm64)
115+
path: ./artifacts
116+
75117
macos:
76118
name: macOS (x64 + arm64)
77119
runs-on: macos-14

.github/workflows/build-nuget.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ jobs:
4747
name: Natives-Windows
4848
path: ./native/win
4949

50+
- name: Download artifacts - native - Windows (arm64)
51+
uses: actions/download-artifact@v8
52+
with:
53+
name: Natives-Windows(arm64)
54+
path: ./native/win
55+
5056
- name: Download artifacts - native - MacOS
5157
uses: actions/download-artifact@v8
5258
with:

OpenRA-FreeType6.nuspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<file src="OpenRA-Freetype6.targets" target="build" />
2525
<file src="native/win/x86/freetype6.dll" target="native/win-x86" />
2626
<file src="native/win/x64/freetype6.dll" target="native/win-x64" />
27+
<file src="native/win/arm64/freetype6.dll" target="native/win-arm64" />
2728
<file src="native/linux/x64/freetype6.so" target="native/linux-x64" />
2829
<file src="native/linux/arm64/freetype6.so" target="native/linux-arm64" />
2930
<file src="native/osx/x86_64/freetype6.dylib" target="native/osx-x64" />

OpenRA-FreeType6.targets

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
<Link>freetype6.dll</Link>
1212
<Visible>false</Visible>
1313
</Content>
14+
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-arm64\freetype6.dll" Condition="'$(TargetPlatform)' == 'win-arm64'">
15+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
16+
<Link>freetype6.dll</Link>
17+
<Visible>false</Visible>
18+
</Content>
1419
<Content Include="$(MSBuildThisFileDirectory)\..\native\linux-x64\freetype6.so" Condition="'$(TargetPlatform)' == 'linux-x64'">
1520
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
1621
<Link>freetype6.so</Link>

0 commit comments

Comments
 (0)