瀏覽代碼

Fix architecture mismatch is macOS build. Replace x64 with x86_64.

Ruben 5 月之前
父節點
當前提交
47a9e8c8fe
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      Build/Build Avalonia.MacOS.ps1

+ 6 - 3
Build/Build Avalonia.MacOS.ps1

@@ -1,10 +1,10 @@
 param (
     [Parameter()]
     [string]$Platform,
-    
+
     [Parameter()]
     [string]$outputPath,
-	
+
     [Parameter()]
     [string]$appVersion
 )
@@ -66,9 +66,12 @@ $infoPlistPath = Join-Path -Path $contentsPath -ChildPath "Info.plist"
 # Read template as text
 $infoPlistContent = Get-Content $infoPlistTemplatePath -Raw
 
+# Map platform identifier to proper macOS architecture identifier
+$macOSArchitecture = if ($Platform -eq "arm64") { "arm64" } else { "x86_64" }
+
 # Replace placeholders with actual values
 $infoPlistContent = $infoPlistContent -replace "{{appVersion}}", $appVersion
-$infoPlistContent = $infoPlistContent -replace "{{platform}}", $Platform
+$infoPlistContent = $infoPlistContent -replace "{{platform}}", $macOSArchitecture
 
 # Save Info.plist with UTF-8 encoding without BOM
 $utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $false