Skip to content

Commit 95edbdf

Browse files
committed
Detect Linux arm
1 parent 93b6ce7 commit 95edbdf

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

build/Build.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<Using Include="Cake.Core.Diagnostics" />
2323
<Using Include="Cake.Core.IO" />
2424
<Using Include="Cake.FileHelpers" />
25+
<Using Include="System.Runtime.InteropServices" />
2526
</ItemGroup>
2627

2728
<ItemGroup>

build/BuildLinuxTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public sealed class BuildLinuxTask : FrostingTask<BuildContext>
99

1010
public override void Run(BuildContext context)
1111
{
12-
Architecture arch = RuntimeInformation.OSArchitecture;
12+
var arch = RuntimeInformation.OSArchitecture;
1313
// Absolute path to the artifact directory is needed for flags since they don't allow relative path
1414
var artifactDir = context.MakeAbsolute(new DirectoryPath(context.ArtifactsDir));
1515
var dependencyDir = context.MakeAbsolute(new DirectoryPath($"{context.ArtifactsDir}/../dependencies-linux-{(arch == Architecture.Arm64 ? "arm64" : "x64")}"));
@@ -84,7 +84,7 @@ private static string GetFFMpegConfigureFlags(BuildContext context)
8484
{
8585
var ignoreCommentsAndNewLines = (string line) => !string.IsNullOrWhiteSpace(line) && !line.StartsWith('#');
8686
var configureFlags = context.FileReadLines("ffmpeg.config").Where(ignoreCommentsAndNewLines);
87-
var osConfigFile = arch == Architecture.Arm64 ? "ffmpeg.linux-arm64.config" : "ffmpeg.linux-x64.config";
87+
var osConfigFile = RuntimeInformation.OSArchitecture == Architecture.Arm64 ? "ffmpeg.linux-arm64.config" : "ffmpeg.linux-x64.config";
8888
var osConfigureFlags = context.FileReadLines(osConfigFile).Where(ignoreCommentsAndNewLines);
8989
return string.Join(' ', configureFlags) + " " + string.Join(' ', osConfigureFlags);
9090
}

0 commit comments

Comments
 (0)