Skip to content

Commit e96d9a2

Browse files
ashwinimurtUnityAlex
authored andcommitted
Turn on Arm64
1 parent 6c9d063 commit e96d9a2

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

external/buildscripts/build_all_osx.pl

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
print(">>> Building x86_64\n");
5353
system("perl", "$buildscriptsdir/build.pl", "--clean=1", "--classlibtests=0", "--targetarch=x86_64", @passAlongArgs) eq 0 or die ('failing building x86_64');
5454

55-
#print(">>> Building ARM64\n");
56-
#system("perl", "$buildscriptsdir/build.pl", "--clean=1", "--classlibtests=0", "--targetarch=arm64", @passAlongArgs) eq 0 or die ("failing building ARM64");
55+
print(">>> Building ARM64\n");
56+
system("perl", "$buildscriptsdir/build.pl", "--clean=1", "--classlibtests=0", "--targetarch=arm64", @passAlongArgs) eq 0 or die ("failing building ARM64");
5757

5858
if ($artifact)
5959
{
@@ -62,17 +62,17 @@
6262
# Copy stuff in the embedruntimes directory
6363
my $embedDirRoot = "$buildsroot/embedruntimes";
6464
my $embedDirSourceX64 = "$embedDirRoot/osx-tmp-x86_64";
65-
#my $embedDirSourceARM64 = "$embedDirRoot/osx-tmp-arm64";
65+
my $embedDirSourceARM64 = "$embedDirRoot/osx-tmp-arm64";
6666

6767
CopyEmbedRuntimeBinaries($embedDirSourceX64, "$embedDirRoot/osx");
68-
#CopyEmbedRuntimeBinaries($embedDirSourceARM64, "$embedDirRoot/osx-arm64");
68+
CopyEmbedRuntimeBinaries($embedDirSourceARM64, "$embedDirRoot/osx-arm64");
6969

7070
# Merge stuff in the monodistribution directory
7171
my $distDirRoot = "$buildsroot/monodistribution";
7272
my $distDirDestinationBin = "$buildsroot/monodistribution/bin";
7373
my $distDirDestinationLib = "$buildsroot/monodistribution/lib";
7474
my $distDirSourceBinX64 = "$distDirRoot/bin-osx-tmp-x86_64";
75-
#my $distDirSourceBinARM64 = "$distDirRoot/bin-osx-tmp-arm64";
75+
my $distDirSourceBinARM64 = "$distDirRoot/bin-osx-tmp-arm64";
7676

7777
# Should always exist because build_all would have put stuff in it, but in some situations
7878
# depending on the options it may not. So create it if it does not exist
@@ -91,15 +91,15 @@
9191
die("Expected source directory not found : $distDirSourceBinX64\n");
9292
}
9393

94-
#if (!(-d $distDirSourceBinARM64))
95-
#{
96-
#die("Expected source directory not found : $distDirSourceBinARM64\n");
97-
#}
94+
if (!(-d $distDirSourceBinARM64))
95+
{
96+
die("Expected source directory not found : $distDirSourceBinARM64\n");
97+
}
9898

9999
for my $file ('mono')
100100
{
101-
#MergeIntoFatBinary("$distDirSourceBinX64/$file", "$distDirSourceBinARM64/$file", "$distDirDestinationBin/$file");
102-
system ('mv', "$distDirSourceBinX64/$file", "$distDirDestinationBin/$file");
101+
MergeIntoFatBinary("$distDirSourceBinX64/$file", "$distDirSourceBinARM64/$file", "$distDirDestinationBin/$file");
102+
#system ('mv', "$distDirSourceBinX64/$file", "$distDirDestinationBin/$file");
103103
}
104104

105105
for my $file ('pedump')
@@ -108,9 +108,14 @@
108108
system ('mv', "$distDirSourceBinX64/$file", "$distDirDestinationBin/$file") eq 0 or die ("Failed to move '$distDirSourceBinX64/$file' to '$distDirDestinationBin/$file'.");
109109
}
110110

111-
for my $file ('libMonoPosixHelper.dylib', 'libmono-native.dylib')
111+
for my $file ('libMonoPosixHelper.dylib')
112+
{
113+
MergeIntoFatBinary("$embedDirSourceX64/$file", "$embedDirSourceARM64/$file", "$distDirDestinationLib/$file");
114+
}
115+
116+
for my $file ('libmono-native.dylib')
112117
{
113-
#MergeIntoFatBinary("$embedDirSourceX64/$file", "$embedDirSourceARM64/$file", "$distDirDestinationLib/$file");
118+
# TODO: libmono-native.dylib may not get cross-compiled and can't merge into fat binary, something to check back later
114119
print(">>> cp $embedDirSourceX64/$file $distDirDestinationLib/$file\n\n");
115120
system ('cp', "$embedDirSourceX64/$file", "$distDirDestinationLib/$file");
116121
}
@@ -120,9 +125,9 @@
120125
print(">>> Clean up temporary arch specific build directories\n");
121126

122127
rmtree("$distDirSourceBinX64");
123-
#rmtree("$distDirSourceBinARM64");
128+
rmtree("$distDirSourceBinARM64");
124129
rmtree("$embedDirSourceX64");
125-
#rmtree("$embedDirSourceARM64");
130+
rmtree("$embedDirSourceARM64");
126131
}
127132
}
128133

0 commit comments

Comments
 (0)