@@ -73,7 +73,8 @@ public boolean accept(File dir, String name) {
7373 return lc .endsWith (".jar" ) || lc .endsWith (".zip" );
7474 }
7575 };
76-
76+
77+
7778 public Library (File folder , String subfolder ) {
7879 super (folder , Library .propertiesFileName );
7980 this .group = subfolder ;
@@ -122,35 +123,24 @@ public Library(File folder, String subfolder) {
122123 String platformName32 = platformName + "32" ;
123124 String platformName64 = platformName + "64" ;
124125
126+ // First check for things like 'application.macosx=' or 'application.windows32' in the export.txt file.
127+ // These will override anything in the platform-specific subfolders.
125128 String platformAll = exportTable .get ("application." + platformName );
126129 String [] platformList = platformAll == null ? null : PApplet .splitTokens (platformAll , ", " );
127-
128130 String platform32 = exportTable .get ("application." + platformName + "32" );
129131 String [] platformList32 = platform32 == null ? null : PApplet .splitTokens (platform32 , ", " );
130-
131132 String platform64 = exportTable .get ("application." + platformName + "64" );
132133 String [] platformList64 = platform64 == null ? null : PApplet .splitTokens (platform64 , ", " );
133134
135+ // If nothing specified in the export.txt entries, look for the platform-specific folders.
134136 if (platformAll == null ) {
135137 platformList = listPlatformEntries (libraryFolder , platformName , baseList );
136- // File folderAll = new File(libraryFolder, platformName);
137- // if (folderAll.exists()) {
138- // platformList = PApplet.concat(baseList, folderAll.list(standardFilter));
139- // }
140138 }
141139 if (platform32 == null ) {
142140 platformList32 = listPlatformEntries (libraryFolder , platformName32 , baseList );
143- // File folder32 = new File(libraryFolder, platformName32);
144- // if (folder32.exists()) {
145- // platformList32 = PApplet.concat(baseList, folder32.list(standardFilter));
146- // }
147141 }
148142 if (platform64 == null ) {
149143 platformList64 = listPlatformEntries (libraryFolder , platformName64 , baseList );
150- // File folder64 = new File(libraryFolder, platformName64);
151- // if (folder64.exists()) {
152- // platformList64 = PApplet.concat(baseList, folder64.list(standardFilter));
153- // }
154144 }
155145
156146 if (platformList32 != null || platformList64 != null ) {
@@ -355,6 +345,15 @@ public String[] getApplicationExportList(int platform, int bits) {
355345 public boolean hasMultipleArch (int platform ) {
356346 return multipleArch [platform ];
357347 }
348+
349+
350+ public boolean supportsArch (int platform , int bits ) {
351+ // If this is a universal library, or has no natives, then we're good.
352+ if (multipleArch [platform ] == false ) {
353+ return true ;
354+ }
355+ return getApplicationExportList (platform , bits ) != null ;
356+ }
358357
359358
360359// static boolean hasMultipleArch(String platformName, ArrayList<LibraryFolder> libraries) {
0 commit comments