Browse Source

Update Dotnet iOS Export Process

Update iOS export to allow for hybrid globalization introduced in .NET 9 while preserving .NET 8 settings. Also allows for custom ICU or no ICU.
Justin Sasso 8 months ago
parent
commit
aa0ed1b469

+ 6 - 1
modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/iOSNativeAOT.targets

@@ -15,7 +15,12 @@
   <Target Name="PrepareBeforeIlcCompile"
           BeforeTargets="IlcCompile">
 
-    <Copy SourceFiles="%(ResolvedRuntimePack.PackageDirectory)/runtimes/$(RuntimeIdentifier)/native/icudt.dat" DestinationFolder="$(PublishDir)"/>
+    <PropertyGroup>
+      <IcuTargetDir>%(ResolvedRuntimePack.PackageDirectory)/runtimes/$(RuntimeIdentifier)/native/icudt.dat</IcuTargetDir>
+      <IcuEnabled Condition="Exists('$(IcuTargetDir)')">true</IcuEnabled>
+    </PropertyGroup>
+
+    <Copy SourceFiles="$(IcuTargetDir)" DestinationFolder="$(PublishDir)" Condition=" '$(IcuEnabled)' == 'true' "/>
 
     <!-- We need to find the path to Xcode so we can set manual linker args to the correct SDKs
         Once https://github.com/dotnet/runtime/issues/88737 is released, we can take this out