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 30
30
import java .io .FileReader ;
31
31
import java .io .IOException ;
32
32
import java .util .ArrayList ;
33
+ import java .util .Arrays ;
33
34
import java .util .List ;
34
35
import java .util .Map ;
35
36
@@ -102,14 +103,19 @@ public boolean compile(boolean _verbose) throws RunnerException {
102
103
if (verbose )
103
104
System .out .println ();
104
105
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
+ }
106
112
for (Library lib : sketch .getImportedLibraries ()) {
107
- if (!lib .supportsArchitecture (arch )) {
113
+ if (!lib .supportsArchitecture (archs )) {
108
114
System .err .println (I18n
109
115
.format (_ ("WARNING: library {0} claims to run on {1} "
110
116
+ "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 ));
113
119
System .err .println ();
114
120
}
115
121
}
Original file line number Diff line number Diff line change 1
1
package processing .app .packages ;
2
2
3
- import static processing .app .helpers .StringUtils .wildcardMatch ;
4
-
5
3
import java .io .File ;
6
4
import java .io .IOException ;
7
5
import java .util .ArrayList ;
@@ -160,9 +158,30 @@ private static Library createLegacyLibrary(File libFolder) {
160
158
return res ;
161
159
}
162
160
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
+ */
163
168
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 ))
166
185
return true ;
167
186
return false ;
168
187
}
You can’t perform that action at this time.
0 commit comments