Skip to content

Commit b78fcf5

Browse files
committed
Merge pull request arduino#1853 from PaulStoffregen/master
If 2 libs have same .h file, use the lib with same dir name
2 parents 5dfafe7 + ef4f0f3 commit b78fcf5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/src/processing/app/Base.java

+7
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,13 @@ public void actionPerformed(ActionEvent event) {
12451245
String packages[] =
12461246
Compiler.headerListFromIncludePath(subfolder.getAbsolutePath());
12471247
for (String pkg : packages) {
1248+
File old = importToLibraryTable.get(pkg);
1249+
if (old != null) {
1250+
// If a library was already found with this header, keep it if
1251+
// the library's directory name matches the header name.
1252+
String name = pkg.substring(0, pkg.length() - 2);
1253+
if (old.getPath().endsWith(name)) continue;
1254+
}
12481255
importToLibraryTable.put(pkg, subfolder);
12491256
}
12501257
} catch (IOException e) {

0 commit comments

Comments
 (0)