Merge pull request #19506 from botantony/go-tags

std_go_args: add `-tags` flag
This commit is contained in:
Mike McQuaid 2025-03-17 09:01:20 +00:00 committed by GitHub
commit 2462e40ca5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -1820,10 +1820,12 @@ class Formula
output: T.any(String, Pathname),
ldflags: T.nilable(T.any(String, T::Array[String])),
gcflags: T.nilable(T.any(String, T::Array[String])),
tags: T.nilable(T.any(String, T::Array[String])),
).returns(T::Array[String])
}
def std_go_args(output: bin/name, ldflags: nil, gcflags: nil)
def std_go_args(output: bin/name, ldflags: nil, gcflags: nil, tags: nil)
args = ["-trimpath", "-o=#{output}"]
args += ["-tags=#{Array(tags).join(" ")}"] if tags
args += ["-ldflags=#{Array(ldflags).join(" ")}"] if ldflags
args += ["-gcflags=#{Array(gcflags).join(" ")}"] if gcflags
args

View File

@ -517,7 +517,7 @@ The `std_*_args` methods, as well as the arguments they pass, are:
"-o=#{output}"
```
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.
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.
#### `std_meson_args`