1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

Added the possibility to override library compatibility check

This commit is contained in:
Cristian Maglie
2013-12-26 01:32:30 +01:00
parent 512925a812
commit 2b53d6988a
2 changed files with 33 additions and 8 deletions

View File

@ -30,6 +30,7 @@ import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -102,14 +103,19 @@ public class Compiler implements MessageConsumer {
if (verbose)
System.out.println();
String arch = Base.getTargetPlatform().getId();
List<String> archs = new ArrayList<String>();
archs.add(Base.getTargetPlatform().getId());
if (prefs.containsKey("architecture.override_check")) {
String[] overrides = prefs.get("architecture.override_check").split(",");
archs.addAll(Arrays.asList(overrides));
}
for (Library lib : sketch.getImportedLibraries()) {
if (!lib.supportsArchitecture(arch)) {
if (!lib.supportsArchitecture(archs)) {
System.err.println(I18n
.format(_("WARNING: library {0} claims to run on {1} "
+ "architecture(s) and may be incompatible with your"
+ " current board which runs on [{2}] architecture."), lib
.getName(), lib.getArchitectures(), arch));
+ " current board which runs on {2} architecture(s)."), lib
.getName(), lib.getArchitectures(), archs));
System.err.println();
}
}