Skip to content

Commit bb0918f

Browse files
committed
Fixed library.IsArchitectureIndependent method.
Now it returns true for libraries that do not specify "architecture" fiels.
1 parent 174f69e commit bb0918f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Diff for: arduino/libraries/libraries.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ func (library *Library) String() string {
8383
// - the library is architecture independent
8484
// - the library doesn't specify any `architecture` field in library.properties
8585
func (library *Library) SupportsAnyArchitectureIn(archs ...string) bool {
86-
if len(library.Architectures) == 0 {
87-
return true
88-
}
8986
if library.IsArchitectureIndependent() {
9087
return true
9188
}
@@ -113,7 +110,7 @@ func (library *Library) IsOptimizedForArchitecture(arch string) bool {
113110
// compatible with all architectures (the `architecture` field in
114111
// library.properties contains the `*` item)
115112
func (library *Library) IsArchitectureIndependent() bool {
116-
return library.IsOptimizedForArchitecture("*")
113+
return library.IsOptimizedForArchitecture("*") || library.Architectures == nil || len(library.Architectures) == 0
117114
}
118115

119116
// SourceDir represents a source dir of a library

0 commit comments

Comments
 (0)