mirror of
https://github.com/golang/go
synced 2024-11-26 14:08:37 -07:00
go/build: support compiler as build constraint
This supports writing different .c/.s code when using gccgo. R=golang-dev, dsymonds, iant, rsc CC=golang-dev https://golang.org/cl/6823055
This commit is contained in:
parent
b11f85a8aa
commit
f07f9de8ec
@ -897,6 +897,8 @@ func splitQuoted(s string) (r []string, err error) {
|
||||
// $GOARCH
|
||||
// cgo (if cgo is enabled)
|
||||
// !cgo (if cgo is disabled)
|
||||
// ctxt.Compiler
|
||||
// !ctxt.Compiler
|
||||
// tag (if tag is listed in ctxt.BuildTags)
|
||||
// !tag (if tag is not listed in ctxt.BuildTags)
|
||||
// a comma-separated list of any of these
|
||||
@ -928,7 +930,7 @@ func (ctxt *Context) match(name string) bool {
|
||||
if ctxt.CgoEnabled && name == "cgo" {
|
||||
return true
|
||||
}
|
||||
if name == ctxt.GOOS || name == ctxt.GOARCH {
|
||||
if name == ctxt.GOOS || name == ctxt.GOARCH || name == ctxt.Compiler {
|
||||
return true
|
||||
}
|
||||
|
||||
|
@ -88,6 +88,7 @@
|
||||
//
|
||||
// - the target operating system, as spelled by runtime.GOOS
|
||||
// - the target architecture, as spelled by runtime.GOARCH
|
||||
// - the compiler being used, currently either "gc" or "gccgo"
|
||||
// - "cgo", if ctxt.CgoEnabled is true
|
||||
// - any additional words listed in ctxt.BuildTags
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user