Skip to content

Commit

Permalink
Merge pull request #18615 from Neved4/go-gcflags
Browse files Browse the repository at this point in the history
Go: Add `-gcflags` to `std_go_args`
  • Loading branch information
MikeMcQuaid authored Oct 25, 2024
2 parents ddfe04a + 219a937 commit bbe5a85
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1837,12 +1837,16 @@ def std_configure_args(prefix: self.prefix, libdir: "lib")

# Standard parameters for Go builds.
sig {
params(output: T.any(String, Pathname),
ldflags: T.nilable(T.any(String, T::Array[String]))).returns(T::Array[String])
params(
output: T.any(String, Pathname),
ldflags: T.nilable(T.any(String, T::Array[String])),
gcflags: T.nilable(T.any(String, T::Array[String])),
).returns(T::Array[String])
}
def std_go_args(output: bin/name, ldflags: nil)
def std_go_args(output: bin/name, ldflags: nil, gcflags: nil)
args = ["-trimpath", "-o=#{output}"]
args += ["-ldflags=#{Array(ldflags).join(" ")}"] if ldflags
args += ["-gcflags=#{Array(gcflags).join(" ")}"] if gcflags
args
end

Expand Down

0 comments on commit bbe5a85

Please sign in to comment.