@@ -48,30 +48,19 @@ func (s *WarnAboutArchIncompatibleLibraries) Run(ctx *types.Context) error {
48
48
buildProperties := ctx .BuildProperties
49
49
logger := ctx .GetLogger ()
50
50
51
- archs := []string {}
52
- archs = append (archs , targetPlatform .Platform .Architecture )
53
-
54
- if buildProperties [constants .BUILD_PROPERTIES_ARCH_OVERRIDE_CHECK ] != constants .EMPTY_STRING {
55
- overrides := strings .Split (buildProperties [constants .BUILD_PROPERTIES_ARCH_OVERRIDE_CHECK ], "," )
56
- for _ , override := range overrides {
57
- archs = append (archs , override )
58
- }
51
+ archs := []string {targetPlatform .Platform .Architecture }
52
+ if overrides , ok := buildProperties [constants .BUILD_PROPERTIES_ARCH_OVERRIDE_CHECK ]; ok {
53
+ archs = append (archs , strings .Split (overrides , "," )... )
59
54
}
60
55
61
56
for _ , importedLibrary := range ctx .ImportedLibraries {
62
- if ! importedLibrary .SupportsArchitectures (archs ) {
63
- logger .Fprintln (os .Stdout , constants .LOG_LEVEL_WARN , constants .MSG_LIBRARY_INCOMPATIBLE_ARCH , importedLibrary .Name , sliceToCommaSeparatedString (importedLibrary .Architectures ), sliceToCommaSeparatedString (archs ))
57
+ if ! importedLibrary .SupportsAnyArchitectureIn (archs ) {
58
+ logger .Fprintln (os .Stdout , constants .LOG_LEVEL_WARN , constants .MSG_LIBRARY_INCOMPATIBLE_ARCH ,
59
+ importedLibrary .Name ,
60
+ strings .Join (importedLibrary .Architectures , ", " ),
61
+ strings .Join (archs , ", " ))
64
62
}
65
63
}
66
64
67
65
return nil
68
66
}
69
-
70
- func sliceToCommaSeparatedString (slice []string ) string {
71
- str := "("
72
- str = str + slice [0 ]
73
- for i := 1 ; i < len (slice ); i ++ {
74
- str = str + ", " + slice [i ]
75
- }
76
- return str + ")"
77
- }
0 commit comments