mirror of
https://github.com/golang/go
synced 2024-11-26 03:37:57 -07:00
cmd/cgo, cmd/go, go/build: sort flag lists
CFLAGS comes before CPPFLAGS. Also fix one typo CPPCFLAGS. Cleanup for CL 8248043. R=golang-dev, iant, alberto.garcia.hierro CC=golang-dev https://golang.org/cl/9965045
This commit is contained in:
parent
63a707e354
commit
f032eefdb0
@ -24,7 +24,7 @@ the C parts of the package. For example:
|
||||
// #include <errno.h>
|
||||
import "C"
|
||||
|
||||
CPPFLAGS, CFLAGS, CXXFLAGS and LDFLAGS may be defined with pseudo #cgo directives
|
||||
CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS may be defined with pseudo #cgo directives
|
||||
within these comments to tweak the behavior of gcc. Values defined
|
||||
in multiple directives are concatenated together. Options prefixed
|
||||
by $GOOS, $GOARCH, or $GOOS/$GOARCH are only defined in matching
|
||||
@ -44,7 +44,7 @@ For example:
|
||||
// #include <png.h>
|
||||
import "C"
|
||||
|
||||
The CGO_CPPFLAGS, CGO_CFLAGS, CGO_CXXFLAGS and CGO_LDFLAGS environment variables are added
|
||||
The CGO_CFLAGS, CGO_CPPFLAGS, CGO_CXXFLAGS and CGO_LDFLAGS environment variables are added
|
||||
to the flags derived from these directives. Package-specific flags should
|
||||
be set using the directives, not the environment variables, so that builds
|
||||
work in unmodified environments.
|
||||
|
@ -321,13 +321,13 @@ which calls strings.Join. The struct being passed to the template is:
|
||||
CXXFiles []string // .cc, .cxx and .cpp source files
|
||||
HFiles []string // .h, .hh, .hpp and .hxx source files
|
||||
SFiles []string // .s source files
|
||||
SysoFiles []string // .syso object files to add to archive
|
||||
SwigFiles []string // .swig files
|
||||
SwigCXXFiles []string // .swigcxx files
|
||||
SysoFiles []string // .syso object files to add to archive
|
||||
|
||||
// Cgo directives
|
||||
CgoCPPFLAGS []string // cgo: flags for C preprocessor
|
||||
CgoCFLAGS []string // cgo: flags for C compiler
|
||||
CgoCPPFLAGS []string // cgo: flags for C preprocessor
|
||||
CgoCXXFLAGS []string // cgo: flags for C++ compiler
|
||||
CgoLDFLAGS []string // cgo: flags for linker
|
||||
CgoPkgConfig []string // cgo: pkg-config names
|
||||
|
@ -49,13 +49,13 @@ which calls strings.Join. The struct being passed to the template is:
|
||||
CXXFiles []string // .cc, .cxx and .cpp source files
|
||||
HFiles []string // .h, .hh, .hpp and .hxx source files
|
||||
SFiles []string // .s source files
|
||||
SysoFiles []string // .syso object files to add to archive
|
||||
SwigFiles []string // .swig files
|
||||
SwigCXXFiles []string // .swigcxx files
|
||||
SysoFiles []string // .syso object files to add to archive
|
||||
|
||||
// Cgo directives
|
||||
CgoCPPFLAGS []string // cgo: flags for C preprocessor
|
||||
CgoCFLAGS []string // cgo: flags for C compiler
|
||||
CgoCPPFLAGS []string // cgo: flags for C preprocessor
|
||||
CgoCXXFLAGS []string // cgo: flags for C++ compiler
|
||||
CgoLDFLAGS []string // cgo: flags for linker
|
||||
CgoPkgConfig []string // cgo: pkg-config names
|
||||
|
@ -43,13 +43,13 @@ type Package struct {
|
||||
CXXFiles []string `json:",omitempty"` // .cc, .cpp and .cxx source files
|
||||
HFiles []string `json:",omitempty"` // .h, .hh, .hpp and .hxx source files
|
||||
SFiles []string `json:",omitempty"` // .s source files
|
||||
SysoFiles []string `json:",omitempty"` // .syso system object files added to package
|
||||
SwigFiles []string `json:",omitempty"` // .swig files
|
||||
SwigCXXFiles []string `json:",omitempty"` // .swigcxx files
|
||||
SysoFiles []string `json:",omitempty"` // .syso system object files added to package
|
||||
|
||||
// Cgo directives
|
||||
CgoCPPFLAGS []string `json:",omitempty"` // cgo: flags for C preprocessor
|
||||
CgoCFLAGS []string `json:",omitempty"` // cgo: flags for C compiler
|
||||
CgoCPPFLAGS []string `json:",omitempty"` // cgo: flags for C preprocessor
|
||||
CgoCXXFLAGS []string `json:",omitempty"` // cgo: flags for C++ compiler
|
||||
CgoLDFLAGS []string `json:",omitempty"` // cgo: flags for linker
|
||||
CgoPkgConfig []string `json:",omitempty"` // cgo: pkg-config names
|
||||
@ -104,11 +104,11 @@ func (p *Package) copyBuild(pp *build.Package) {
|
||||
p.CXXFiles = pp.CXXFiles
|
||||
p.HFiles = pp.HFiles
|
||||
p.SFiles = pp.SFiles
|
||||
p.SysoFiles = pp.SysoFiles
|
||||
p.SwigFiles = pp.SwigFiles
|
||||
p.SwigCXXFiles = pp.SwigCXXFiles
|
||||
p.CgoCPPFLAGS = pp.CgoCPPFLAGS
|
||||
p.SysoFiles = pp.SysoFiles
|
||||
p.CgoCFLAGS = pp.CgoCFLAGS
|
||||
p.CgoCPPFLAGS = pp.CgoCPPFLAGS
|
||||
p.CgoCXXFLAGS = pp.CgoCXXFLAGS
|
||||
p.CgoLDFLAGS = pp.CgoLDFLAGS
|
||||
p.CgoPkgConfig = pp.CgoPkgConfig
|
||||
|
@ -356,13 +356,13 @@ type Package struct {
|
||||
CXXFiles []string // .cc, .cpp and .cxx source files
|
||||
HFiles []string // .h, .hh, .hpp and .hxx source files
|
||||
SFiles []string // .s source files
|
||||
SysoFiles []string // .syso system object files to add to archive
|
||||
SwigFiles []string // .swig files
|
||||
SwigCXXFiles []string // .swigcxx files
|
||||
SysoFiles []string // .syso system object files to add to archive
|
||||
|
||||
// Cgo directives
|
||||
CgoCPPFLAGS []string // Cgo CPPFLAGS directives
|
||||
CgoCFLAGS []string // Cgo CFLAGS directives
|
||||
CgoCPPFLAGS []string // Cgo CPPFLAGS directives
|
||||
CgoCXXFLAGS []string // Cgo CXXFLAGS directives
|
||||
CgoLDFLAGS []string // Cgo LDFLAGS directives
|
||||
CgoPkgConfig []string // Cgo pkg-config directives
|
||||
@ -857,7 +857,7 @@ func (ctxt *Context) shouldBuild(content []byte) bool {
|
||||
}
|
||||
|
||||
// saveCgo saves the information from the #cgo lines in the import "C" comment.
|
||||
// These lines set CPPCFLAGS, CFLAGS, CXXFLAGS and LDFLAGS and pkg-config directives
|
||||
// These lines set CFLAGS, CPPFLAGS, CXXFLAGS and LDFLAGS and pkg-config directives
|
||||
// that affect the way cgo's C code is built.
|
||||
//
|
||||
// TODO(rsc): This duplicates code in cgo.
|
||||
|
Loading…
Reference in New Issue
Block a user