diff --git a/source/dub/compilers/buildsettings.d b/source/dub/compilers/buildsettings.d index 7fcf289..594d38f 100644 --- a/source/dub/compilers/buildsettings.d +++ b/source/dub/compilers/buildsettings.d @@ -13,7 +13,8 @@ import std.algorithm : filter, any; import std.path : globMatch; import std.typecons : BitFlags; - +import std.algorithm.iteration : uniq; +import std.range : chain; /// BuildPlatform specific settings, like needed libraries or additional /// include paths. @@ -105,7 +106,7 @@ addPostRunCommands(bs.postRunCommands); } - void addDFlags(in string[] value...) { dflags ~= value; } + void addDFlags(in string[] value...) { dflags = chain(dflags, value.dup).uniq.array; } void prependDFlags(in string[] value...) { prepend(dflags, value); } void removeDFlags(in string[] value...) { remove(dflags, value); } void addLFlags(in string[] value...) { lflags ~= value; }