Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
os: [windows-latest, ubuntu-latest, macos-latest, ubuntu-22.04-arm]
fail-fast: false
steps:
- name: Expose GitHub Runtime
Expand Down
3 changes: 2 additions & 1 deletion build/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<Using Include="Cake.Core.Diagnostics" />
<Using Include="Cake.Core.IO" />
<Using Include="Cake.FileHelpers" />
<Using Include="System.Runtime.InteropServices" />
</ItemGroup>

<ItemGroup>
Expand All @@ -34,4 +35,4 @@
<ProjectReference Include="..\buildscripts\MonoGame.Tool.BuildScripts.csproj" />
</ItemGroup>

</Project>
</Project>
8 changes: 5 additions & 3 deletions build/BuildLinuxTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ public sealed class BuildLinuxTask : FrostingTask<BuildContext>
public override void Run(BuildContext context)
{
// Absolute path to the artifact directory is needed for flags since they don't allow relative path
var arch = RuntimeInformation.OSArchitecture;
var artifactDir = context.MakeAbsolute(new DirectoryPath(context.ArtifactsDir));
var dependencyDir = context.MakeAbsolute(new DirectoryPath($"{context.ArtifactsDir}/../dependencies-linux-x64"));
var dependencyDir = context.MakeAbsolute(new DirectoryPath($"{context.ArtifactsDir}/../dependencies-linux-{(arch == Architecture.Arm64 ? "arm64" : "x64")}"));
var prefixFlag = $"--prefix=\"{dependencyDir}\"";
var hostFlag = "--host=\"x86_64-linux-gnu\"";
var hostFlag = arch == Architecture.Arm64 ? "--host=\"aarch64-linux-gnu\"" : "--host=\"x86_64-linux-gnu\"";
var binDirFlag = $"--bindir=\"{artifactDir}\"";

var envVariables = new Dictionary<string, string>
Expand Down Expand Up @@ -85,7 +86,8 @@ private static string GetFFMpegConfigureFlags(BuildContext context)
{
var ignoreCommentsAndNewLines = (string line) => !string.IsNullOrWhiteSpace(line) && !line.StartsWith('#');
var configureFlags = context.FileReadLines("ffprobe.config").Where(ignoreCommentsAndNewLines);
var osConfigureFlags = context.FileReadLines($"ffprobe.linux-x64.config").Where(ignoreCommentsAndNewLines);
var osConfigFile = RuntimeInformation.OSArchitecture == Architecture.Arm64 ? "ffprobe.linux-arm64.config" : "ffprobe.linux-x64.config";
var osConfigureFlags = context.FileReadLines(osConfigFile).Where(ignoreCommentsAndNewLines);
return string.Join(' ', configureFlags) + " " + string.Join(' ', osConfigureFlags);
}
}
10 changes: 10 additions & 0 deletions ffprobe.linux-arm64.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
########################################################################################################################
### Toolchain Options
########################################################################################################################
--arch=aarch64
--target-os=linux

########################################################################################################################
### Optimization Options
########################################################################################################################
--enable-neon