@@ -71,6 +71,7 @@ public boolean accept(File dir, String name) {
7171 if (name .equals ("linux32" )) return false ;
7272 if (name .equals ("linux64" )) return false ;
7373 if (name .equals ("linux-armv6hf" )) return false ;
74+ if (name .equals ("linux-arm64" )) return false ;
7475 if (name .equals ("android" )) return false ;
7576 }
7677 return true ;
@@ -173,6 +174,12 @@ protected void handle() {
173174 nativeLibraryFolder = hostLibrary ;
174175 }
175176 }
177+ if (hostPlatform .equals ("linux" ) && System .getProperty ("os.arch" ).equals ("aarch64" )) {
178+ hostLibrary = new File (libraryFolder , "linux-arm64" );
179+ if (hostLibrary .exists ()) {
180+ nativeLibraryFolder = hostLibrary ;
181+ }
182+ }
176183
177184 // save that folder for later use
178185 nativeLibraryPath = nativeLibraryFolder .getAbsolutePath ();
@@ -183,6 +190,7 @@ protected void handle() {
183190 String platformName32 = platformName + "32" ;
184191 String platformName64 = platformName + "64" ;
185192 String platformNameArmv6hh = platformName + "-armv6hf" ;
193+ String platformNameArm64 = platformName + "-arm64" ;
186194
187195 // First check for things like 'application.macosx=' or 'application.windows32' in the export.txt file.
188196 // These will override anything in the platform-specific subfolders.
@@ -194,6 +202,8 @@ protected void handle() {
194202 String [] platformList64 = platform64 == null ? null : PApplet .splitTokens (platform64 , ", " );
195203 String platformArmv6hf = exportTable .get ("application." + platformName + "-armv6hf" );
196204 String [] platformListArmv6hf = platformArmv6hf == null ? null : PApplet .splitTokens (platformArmv6hf , ", " );
205+ String platformArm64 = exportTable .get ("application." + platformName + "-arm64" );
206+ String [] platformListArm64 = platformArm64 == null ? null : PApplet .splitTokens (platformArm64 , ", " );
197207
198208 // If nothing specified in the export.txt entries, look for the platform-specific folders.
199209 if (platformAll == null ) {
@@ -208,14 +218,17 @@ protected void handle() {
208218 if (platformListArmv6hf == null ) {
209219 platformListArmv6hf = listPlatformEntries (libraryFolder , platformNameArmv6hh , baseList );
210220 }
221+ if (platformListArm64 == null ) {
222+ platformListArm64 = listPlatformEntries (libraryFolder , platformNameArm64 , baseList );
223+ }
211224
212- if (platformList32 != null || platformList64 != null || platformListArmv6hf != null ) {
225+ if (platformList32 != null || platformList64 != null || platformListArmv6hf != null || platformListArm64 != null ) {
213226 multipleArch [i ] = true ;
214227 }
215228
216229 // if there aren't any relevant imports specified or in their own folders,
217230 // then use the baseList (root of the library folder) as the default.
218- if (platformList == null && platformList32 == null && platformList64 == null && platformListArmv6hf == null ) {
231+ if (platformList == null && platformList32 == null && platformList64 == null && platformListArmv6hf == null && platformListArm64 == null ) {
219232 exportList .put (platformName , baseList );
220233
221234 } else {
@@ -233,6 +246,9 @@ protected void handle() {
233246 if (platformListArmv6hf != null ) {
234247 exportList .put (platformNameArmv6hh , platformListArmv6hf );
235248 }
249+ if (platformListArm64 != null ) {
250+ exportList .put (platformNameArm64 , platformListArm64 );
251+ }
236252 }
237253 }
238254// for (String p : exportList.keySet()) {
@@ -412,6 +428,9 @@ public String[] getApplicationExportList(int platform, String variant) {
412428 } else if (variant .equals ("armv6hf" )) {
413429 String [] pieces = exportList .get (platformName + "-armv6hf" );
414430 if (pieces != null ) return pieces ;
431+ } else if (variant .equals ("arm64" )) {
432+ String [] pieces = exportList .get (platformName + "-arm64" );
433+ if (pieces != null ) return pieces ;
415434 }
416435 return exportList .get (platformName );
417436 }
0 commit comments