Skip to content

Commit 5cefb84

Browse files
committed
Allow unnamed flavors to override the default build
Use this to always use the modified build flags for bisonw systray flavor by default for its Windows build.
1 parent 5e0732e commit 5cefb84

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

main.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ var dists = []dist{{
148148
relver: bisonwalletRelver,
149149
tools: []buildtool{
150150
{"decred.org/dcrdex/client/cmd/bisonw", "./dcrdex", []flavor{
151-
{"tray", "windows", func(tags, ldflags string) (string, string) {
151+
{"", "windows", func(tags, ldflags string) (string, string) {
152152
tags += ",systray"
153153
ldflags += " -H=windowsgui"
154154
return tags, ldflags
@@ -233,14 +233,20 @@ func (d *dist) release() {
233233
if *nobuild {
234234
break
235235
}
236-
build(tool.tool, tool.builddir, target.os, target.arch, d.ldflags, nil)
236+
var flavorOverridesDefault bool
237237
for _, f := range tool.flavors {
238238
if f.os != "" && f.os != target.os {
239239
continue
240240
}
241+
if f.flavor == "" {
242+
flavorOverridesDefault = true
243+
}
241244
build(tool.tool, tool.builddir, target.os,
242245
target.arch, d.ldflags, &f)
243246
}
247+
if len(tool.flavors) == 0 || !flavorOverridesDefault {
248+
build(tool.tool, tool.builddir, target.os, target.arch, d.ldflags, nil)
249+
}
244250
}
245251
if *noarchive {
246252
continue

0 commit comments

Comments
 (0)