提交 471bb32a 编写于 作者: A aarzilli 提交者: Derek Parker

cmd/dlv: do not override user's CGO_CFLAGS

Fixes #1278
上级 3f9875e2
......@@ -5,6 +5,7 @@ import (
"github.com/derekparker/delve/cmd/dlv/cmds"
"github.com/derekparker/delve/pkg/version"
"github.com/sirupsen/logrus"
)
// Build is the git sha of this binaries build.
......@@ -14,6 +15,11 @@ func main() {
if Build != "" {
version.DelveVersion.Build = Build
}
os.Setenv("CGO_CFLAGS", "-O -g")
const cgoCflagsEnv = "CGO_CFLAGS"
if os.Getenv(cgoCflagsEnv) == "" {
os.Setenv(cgoCflagsEnv, "-O -g")
} else {
logrus.WithFields(logrus.Fields{"layer": "dlv"}).Warnln("CGO_CFLAGS already set, Cgo code could be optimized.")
}
cmds.New(false).Execute()
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册