Merge pull request #19506 from botantony/go-tags
std_go_args: add `-tags` flag
This commit is contained in:
		
						commit
						2462e40ca5
					
				@ -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
 | 
				
			||||||
 | 
				
			|||||||
@ -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`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user