Commit adbca13c authored by Shenghou Ma's avatar Shenghou Ma

[dev.cc] runtime: explicitly exclude android in zgoos_linux.go

Otherwise both zgoos_linux.go and zgoos_android.go will be compiled
for GOOS=android.

LGTM=crawshaw, rsc
R=rsc, crawshaw
CC=golang-codereviews
https://golang.org/cl/178110043
parent cabc5553
......@@ -46,7 +46,9 @@ func main() {
for _, target := range gooses {
var buf bytes.Buffer
fmt.Fprintf(&buf, "// generated by gengoos.go using 'go generate'\n\n")
fmt.Fprintf(&buf, "// +build %s\n\n", target) // usually redundant, but not always; see linux vs android
if target == "linux" {
fmt.Fprintf(&buf, "// +build !android\n\n") // must explicitly exclude android for linux
}
fmt.Fprintf(&buf, "package runtime\n\n")
fmt.Fprintf(&buf, "const theGoos = `%s`\n\n", target)
for _, goos := range gooses {
......
// generated by gengoos.go using 'go generate'
// +build android
package runtime
const theGoos = `android`
......
// generated by gengoos.go using 'go generate'
// +build darwin
package runtime
const theGoos = `darwin`
......
// generated by gengoos.go using 'go generate'
// +build dragonfly
package runtime
const theGoos = `dragonfly`
......
// generated by gengoos.go using 'go generate'
// +build freebsd
package runtime
const theGoos = `freebsd`
......
// generated by gengoos.go using 'go generate'
// +build linux
// +build !android
package runtime
......
// generated by gengoos.go using 'go generate'
// +build nacl
package runtime
const theGoos = `nacl`
......
// generated by gengoos.go using 'go generate'
// +build netbsd
package runtime
const theGoos = `netbsd`
......
// generated by gengoos.go using 'go generate'
// +build openbsd
package runtime
const theGoos = `openbsd`
......
// generated by gengoos.go using 'go generate'
// +build plan9
package runtime
const theGoos = `plan9`
......
// generated by gengoos.go using 'go generate'
// +build solaris
package runtime
const theGoos = `solaris`
......
// generated by gengoos.go using 'go generate'
// +build windows
package runtime
const theGoos = `windows`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment