Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 69 additions & 18 deletions .github/workflows/build-natives.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,91 @@ permissions:

jobs:
windows:
name: Windows (x86 + x64)
runs-on: ubuntu-22.04
name: Windows (x64)
runs-on: windows-2022
steps:
- name: Clone repository
uses: actions/checkout@v7

- name: Setup Dependencies
shell: pwsh
run: |
mkdir -p artifacts/x86
mkdir artifacts/x64
sudo apt-get install mingw-w64
New-Item -ItemType Directory -Force -Path artifacts/x64 | Out-Null

- name: Compile natives
shell: pwsh
run: |
curl -s -L -O https://github.com/freetype/freetype/archive/refs/tags/${FREETYPE_VERSION}.zip
unzip ${FREETYPE_VERSION}.zip
mkdir freetype-${FREETYPE_VERSION}/build
cd freetype-${FREETYPE_VERSION}
patch -p0 < ../win64.patch
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../../mingw-x86.cmake -DBUILD_SHARED_LIBS=true -DCMAKE_BUILD_TYPE=Release -DFT_DISABLE_ZLIB=TRUE -DFT_DISABLE_BZIP2=TRUE -DFT_DISABLE_PNG=TRUE -DFT_DISABLE_HARFBUZZ=TRUE -DFT_DISABLE_BROTLI=TRUE -DCMAKE_SHARED_LINKER_FLAGS="-static-libgcc"
cmake --build .
cp libfreetype.dll ../../artifacts/x86/freetype6.dll
rm -rf *
cmake .. -DCMAKE_TOOLCHAIN_FILE=../../mingw-x64.cmake -DBUILD_SHARED_LIBS=true -DCMAKE_BUILD_TYPE=Release -DFT_DISABLE_ZLIB=TRUE -DFT_DISABLE_BZIP2=TRUE -DFT_DISABLE_PNG=TRUE -DFT_DISABLE_HARFBUZZ=TRUE -DFT_DISABLE_BROTLI=TRUE
cmake --build .
cp libfreetype.dll ../../artifacts/x64/freetype6.dll
$zip = "${env:FREETYPE_VERSION}.zip"
Invoke-WebRequest -Uri "https://github.com/freetype/freetype/archive/refs/tags/$zip" -OutFile $zip
Expand-Archive -Path $zip -DestinationPath .

$src = "freetype-${env:FREETYPE_VERSION}"
Push-Location $src
patch -p0 -i ..\win64.patch
Pop-Location

cmake -S $src -B "$src\build-x64" `
-A x64 `
-DBUILD_SHARED_LIBS=TRUE `
-DCMAKE_BUILD_TYPE=Release `
-DFT_DISABLE_ZLIB=TRUE `
-DFT_DISABLE_BZIP2=TRUE `
-DFT_DISABLE_PNG=TRUE `
-DFT_DISABLE_HARFBUZZ=TRUE `
-DFT_DISABLE_BROTLI=TRUE

cmake --build "$src\build-x64" --config Release
Copy-Item "$src\build-x64\Release\freetype.dll" "artifacts\x64\freetype6.dll" -Force

- name: Upload Artifacts
uses: actions/upload-artifact@v7
with:
name: Natives-Windows
path: ./artifacts

windows-arm64:
name: Windows (arm64)
runs-on: windows-11-arm
steps:
- name: Clone repository
uses: actions/checkout@v7

- name: Setup Dependencies
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path artifacts/arm64 | Out-Null

- name: Compile natives
shell: pwsh
run: |
$zip = "${env:FREETYPE_VERSION}.zip"
Invoke-WebRequest -Uri "https://github.com/freetype/freetype/archive/refs/tags/$zip" -OutFile $zip
Expand-Archive -Path $zip -DestinationPath .

$src = "freetype-${env:FREETYPE_VERSION}"
Push-Location $src
patch -p0 -i ..\win64.patch
Pop-Location

cmake -S $src -B "$src\build-arm64" `
-A ARM64 `
-DBUILD_SHARED_LIBS=TRUE `
-DCMAKE_BUILD_TYPE=Release `
-DFT_DISABLE_ZLIB=TRUE `
-DFT_DISABLE_BZIP2=TRUE `
-DFT_DISABLE_PNG=TRUE `
-DFT_DISABLE_HARFBUZZ=TRUE `
-DFT_DISABLE_BROTLI=TRUE

cmake --build "$src\build-arm64" --config Release
Copy-Item "$src\build-arm64\Release\freetype.dll" "artifacts\arm64\freetype6.dll" -Force

- name: Upload Artifacts
uses: actions/upload-artifact@v7
with:
name: Natives-Windows(arm64)
path: ./artifacts

macos:
name: macOS (x64 + arm64)
runs-on: macos-14
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ jobs:
name: Natives-Windows
path: ./native/win

- name: Download artifacts - native - Windows (arm64)
uses: actions/download-artifact@v8
with:
name: Natives-Windows(arm64)
path: ./native/win

- name: Download artifacts - native - MacOS
uses: actions/download-artifact@v8
with:
Expand Down
2 changes: 1 addition & 1 deletion OpenRA-FreeType6.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
</metadata>
<files>
<file src="OpenRA-Freetype6.targets" target="build" />
<file src="native/win/x86/freetype6.dll" target="native/win-x86" />
<file src="native/win/x64/freetype6.dll" target="native/win-x64" />
<file src="native/win/arm64/freetype6.dll" target="native/win-arm64" />
<file src="native/linux/x64/freetype6.so" target="native/linux-x64" />
<file src="native/linux/arm64/freetype6.so" target="native/linux-arm64" />
<file src="native/osx/x86_64/freetype6.dylib" target="native/osx-x64" />
Expand Down
4 changes: 2 additions & 2 deletions OpenRA-FreeType6.targets
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-x86\freetype6.dll" Condition="'$(TargetPlatform)' == 'win-x86'">
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-x64\freetype6.dll" Condition="'$(TargetPlatform)' == 'win-x64'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>freetype6.dll</Link>
<Visible>false</Visible>
</Content>
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-x64\freetype6.dll" Condition="'$(TargetPlatform)' == 'win-x64'">
<Content Include="$(MSBuildThisFileDirectory)\..\native\win-arm64\freetype6.dll" Condition="'$(TargetPlatform)' == 'win-arm64'">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>freetype6.dll</Link>
<Visible>false</Visible>
Expand Down
24 changes: 0 additions & 24 deletions mingw-x64.cmake

This file was deleted.

24 changes: 0 additions & 24 deletions mingw-x86.cmake

This file was deleted.