@@ -210,21 +210,21 @@ func extractCompileFlags(ctx *types.Context, receipe string, defines, libs, link
210
210
211
211
for _ , arg := range command .Args {
212
212
if strings .HasPrefix (arg , "-D" ) {
213
- * defines = appendIfUnique (* defines , arg )
213
+ * defines = utils . AppendIfNotPresent (* defines , arg )
214
214
continue
215
215
}
216
216
if strings .HasPrefix (arg , "-l" ) {
217
- * libs = appendIfUnique (* libs , arg )
217
+ * libs = utils . AppendIfNotPresent (* libs , arg )
218
218
continue
219
219
}
220
220
if strings .HasPrefix (arg , "-L" ) {
221
- * linkDirectories = appendIfUnique (* linkDirectories , strings .TrimPrefix (arg , "-L" ))
221
+ * linkDirectories = utils . AppendIfNotPresent (* linkDirectories , strings .TrimPrefix (arg , "-L" ))
222
222
continue
223
223
}
224
224
if strings .HasPrefix (arg , "-" ) && ! strings .HasPrefix (arg , "-I" ) && ! strings .HasPrefix (arg , "-o" ) {
225
225
// HACK : from linkerflags remove MMD (no cache is produced)
226
226
if ! strings .HasPrefix (arg , "-MMD" ) {
227
- * linkerflags = appendIfUnique (* linkerflags , arg )
227
+ * linkerflags = utils . AppendIfNotPresent (* linkerflags , arg )
228
228
}
229
229
}
230
230
}
@@ -241,10 +241,3 @@ func findUniqueFoldersRelative(slice []string, base string) string {
241
241
}
242
242
return strings .Join (out , " " )
243
243
}
244
-
245
- func appendIfUnique (slice []string , element string ) []string {
246
- if ! utils .SliceContains (slice , element ) {
247
- slice = append (slice , element )
248
- }
249
- return slice
250
- }
0 commit comments