Skip to content

Commit

Permalink
[OSX] When HybridGlobalization mode is on load hybrid icu file (#88041)
Browse files Browse the repository at this point in the history
Load icudt_hybrid.dat file when hybrid mode is on
  • Loading branch information
mkhamoyan authored Jun 30, 2023
1 parent 8a09ed7 commit ddf47f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/tasks/AppleAppBuilder/Templates/runtime.m
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,11 @@

char icu_dat_path [1024];
int res;

#if defined(HYBRID_GLOBALIZATION)
res = snprintf (icu_dat_path, sizeof (icu_dat_path) - 1, "%s/%s", bundle, "icudt_hybrid.dat");
#else
res = snprintf (icu_dat_path, sizeof (icu_dat_path) - 1, "%s/%s", bundle, "icudt.dat");
#endif
assert (res > 0);

// TODO: set TRUSTED_PLATFORM_ASSEMBLIES, APP_PATHS and NATIVE_DLL_SEARCH_DIRECTORIES
Expand Down
5 changes: 3 additions & 2 deletions src/tasks/AppleAppBuilder/Xcode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public string GenerateCMake(
bool useNativeAOTRuntime = false)
{
// bundle everything as resources excluding native files
var predefinedExcludes = new List<string> { ".dll.o", ".dll.s", ".dwarf", ".m", ".h", ".a", ".bc", "libmonosgen-2.0.dylib", "libcoreclr.dylib", "icudt_*" };
var predefinedExcludes = new List<string> { ".dll.o", ".dll.s", ".dwarf", ".m", ".h", ".a", ".bc", "libmonosgen-2.0.dylib", "libcoreclr.dylib", "icudt*" };
predefinedExcludes = predefinedExcludes.Concat(excludes).ToList();
if (!preferDylibs)
{
Expand All @@ -268,7 +268,8 @@ public string GenerateCMake(
}

string[] resources = Directory.GetFileSystemEntries(workspace, "", SearchOption.TopDirectoryOnly)
.Where(f => !predefinedExcludes.Any(e => (!e.EndsWith('*') && f.EndsWith(e, StringComparison.InvariantCultureIgnoreCase)) || (e.EndsWith('*') && Path.GetFileName(f).StartsWith(e.TrimEnd('*'), StringComparison.InvariantCultureIgnoreCase))))
.Where(f => !predefinedExcludes.Any(e => (!e.EndsWith('*') && f.EndsWith(e, StringComparison.InvariantCultureIgnoreCase)) || (e.EndsWith('*') && Path.GetFileName(f).StartsWith(e.TrimEnd('*'), StringComparison.InvariantCultureIgnoreCase) &&
!(hybridGlobalization ? Path.GetFileName(f) == "icudt_hybrid.dat" : Path.GetFileName(f) == "icudt.dat"))))
.ToArray();

if (string.IsNullOrEmpty(nativeMainSource))
Expand Down

0 comments on commit ddf47f0

Please # to comment.