File tree Expand file tree Collapse file tree 2 files changed +33
-8
lines changed
Expand file tree Collapse file tree 2 files changed +33
-8
lines changed Original file line number Diff line number Diff line change 3030import java .io .FileReader ;
3131import java .io .IOException ;
3232import java .util .ArrayList ;
33+ import java .util .Arrays ;
3334import java .util .List ;
3435import java .util .Map ;
3536
@@ -102,14 +103,19 @@ public boolean compile(boolean _verbose) throws RunnerException {
102103 if (verbose )
103104 System .out .println ();
104105
105- String arch = Base .getTargetPlatform ().getId ();
106+ List <String > archs = new ArrayList <String >();
107+ archs .add (Base .getTargetPlatform ().getId ());
108+ if (prefs .containsKey ("architecture.override_check" )) {
109+ String [] overrides = prefs .get ("architecture.override_check" ).split ("," );
110+ archs .addAll (Arrays .asList (overrides ));
111+ }
106112 for (Library lib : sketch .getImportedLibraries ()) {
107- if (!lib .supportsArchitecture (arch )) {
113+ if (!lib .supportsArchitecture (archs )) {
108114 System .err .println (I18n
109115 .format (_ ("WARNING: library {0} claims to run on {1} "
110116 + "architecture(s) and may be incompatible with your"
111- + " current board which runs on [ {2}] architecture." ), lib
112- .getName (), lib .getArchitectures (), arch ));
117+ + " current board which runs on {2} architecture(s) ." ), lib
118+ .getName (), lib .getArchitectures (), archs ));
113119 System .err .println ();
114120 }
115121 }
Original file line number Diff line number Diff line change 11package processing .app .packages ;
22
3- import static processing .app .helpers .StringUtils .wildcardMatch ;
4-
53import java .io .File ;
64import java .io .IOException ;
75import java .util .ArrayList ;
@@ -160,9 +158,30 @@ private static Library createLegacyLibrary(File libFolder) {
160158 return res ;
161159 }
162160
161+ /**
162+ * Returns <b>true</b> if the library declares to support the specified
163+ * architecture (through the "architectures" property field).
164+ *
165+ * @param reqArch
166+ * @return
167+ */
163168 public boolean supportsArchitecture (String reqArch ) {
164- for (String arch : architectures )
165- if (wildcardMatch (reqArch , arch ))
169+ return architectures .contains (reqArch ) || architectures .contains ("*" );
170+ }
171+
172+ /**
173+ * Returns <b>true</b> if the library declares to support at least one of the
174+ * specified architectures.
175+ *
176+ * @param reqArchs
177+ * A List of architectures to check
178+ * @return
179+ */
180+ public boolean supportsArchitecture (List <String > reqArchs ) {
181+ if (reqArchs .contains ("*" ))
182+ return true ;
183+ for (String reqArch : reqArchs )
184+ if (supportsArchitecture (reqArch ))
166185 return true ;
167186 return false ;
168187 }
You can’t perform that action at this time.
0 commit comments