Skip to content

Commit 2462e40

Browse files
authored
Merge pull request Homebrew#19506 from botantony/go-tags
std_go_args: add `-tags` flag
2 parents c4fe6f2 + 96eacb7 commit 2462e40

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

Library/Homebrew/formula.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1820,10 +1820,12 @@ def std_configure_args(prefix: self.prefix, libdir: "lib")
18201820
output: T.any(String, Pathname),
18211821
ldflags: T.nilable(T.any(String, T::Array[String])),
18221822
gcflags: T.nilable(T.any(String, T::Array[String])),
1823+
tags: T.nilable(T.any(String, T::Array[String])),
18231824
).returns(T::Array[String])
18241825
}
1825-
def std_go_args(output: bin/name, ldflags: nil, gcflags: nil)
1826+
def std_go_args(output: bin/name, ldflags: nil, gcflags: nil, tags: nil)
18261827
args = ["-trimpath", "-o=#{output}"]
1828+
args += ["-tags=#{Array(tags).join(" ")}"] if tags
18271829
args += ["-ldflags=#{Array(ldflags).join(" ")}"] if ldflags
18281830
args += ["-gcflags=#{Array(gcflags).join(" ")}"] if gcflags
18291831
args

docs/Formula-Cookbook.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ The `std_*_args` methods, as well as the arguments they pass, are:
517517
"-o=#{output}"
518518
```
519519

520-
It also provides a convenient way to set `-ldflags` and `-gcflags`, see examples: [`babelfish`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/b/babelfish.rb) and [`wazero`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/w/wazero.rb) formulae.
520+
It also provides a convenient way to set `-ldflags`, `-gcflags`, and `-tags`, see examples: [`babelfish`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/b/babelfish.rb) and [`wazero`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/w/wazero.rb) formulae.
521521

522522
#### `std_meson_args`
523523

0 commit comments

Comments
 (0)