compiler: add support for CGO_ENABLED environment variable

This commit is contained in:
Ayke van Laethem
2019-12-30 20:58:10 +01:00
committed by Ron Evans
parent 9a69c6bcca
commit 1a32a68674
3 changed files with 16 additions and 2 deletions
+2 -2
View File
@@ -193,7 +193,7 @@ func (c *Compiler) Compile(mainPath string) []error {
GOOS: c.GOOS(),
GOROOT: goenv.Get("GOROOT"),
GOPATH: goenv.Get("GOPATH"),
CgoEnabled: true,
CgoEnabled: c.CgoEnabled(),
UseAllFiles: false,
Compiler: "gc", // must be one of the recognized compilers
BuildTags: c.BuildTags(),
@@ -203,7 +203,7 @@ func (c *Compiler) Compile(mainPath string) []error {
GOOS: c.GOOS(),
GOROOT: goenv.Get("TINYGOROOT"),
GOPATH: overlayGopath,
CgoEnabled: true,
CgoEnabled: c.CgoEnabled(),
UseAllFiles: false,
Compiler: "gc", // must be one of the recognized compilers
BuildTags: c.BuildTags(),