std_go_args: add -tags flag

Signed-off-by: botantony <antonsm21@gmail.com>
This commit is contained in:
botantony 2025-03-16 21:41:19 +01:00
parent c4fe6f2c29
commit 96eacb7fd9
No known key found for this signature in database
GPG Key ID: 7FE721557EA6AAD6
2 changed files with 4 additions and 2 deletions

View File

@ -1820,10 +1820,12 @@ class Formula
output: T.any(String, Pathname), output: T.any(String, Pathname),
ldflags: T.nilable(T.any(String, T::Array[String])), ldflags: T.nilable(T.any(String, T::Array[String])),
gcflags: 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]) ).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 = ["-trimpath", "-o=#{output}"]
args += ["-tags=#{Array(tags).join(" ")}"] if tags
args += ["-ldflags=#{Array(ldflags).join(" ")}"] if ldflags args += ["-ldflags=#{Array(ldflags).join(" ")}"] if ldflags
args += ["-gcflags=#{Array(gcflags).join(" ")}"] if gcflags args += ["-gcflags=#{Array(gcflags).join(" ")}"] if gcflags
args args

View File

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