mirror of
https://github.com/gravitational/teleport
synced 2024-10-19 16:53:57 +00:00
Support debug builds with TELEPORT_DEBUG (#18317)
For debug builds, we don't want to strip the symbol table of DWARF debug information. Additionally, disable inlining and other optimizations that may interfere with debugging. See https://go.googlesource.com/vscode-go/+/HEAD/docs/debugging.md
This commit is contained in:
parent
4cdee9ae68
commit
4046b65632
9
Makefile
9
Makefile
|
@ -28,9 +28,16 @@ ADDFLAGS ?=
|
|||
PWD ?= `pwd`
|
||||
TELEPORT_DEBUG ?= false
|
||||
GITTAG=v$(VERSION)
|
||||
BUILDFLAGS ?= $(ADDFLAGS) -ldflags '-w -s' -trimpath
|
||||
CGOFLAG ?= CGO_ENABLED=1
|
||||
|
||||
# When TELEPORT_DEBUG is true, set flags to produce
|
||||
# debugger-friendly builds.
|
||||
ifeq ("$(TELEPORT_DEBUG)","true")
|
||||
BUILDFLAGS ?= $(ADDFLAGS) -gcflags=all="-N -l"
|
||||
else
|
||||
BUILDFLAGS ?= $(ADDFLAGS) -ldflags '-w -s' -trimpath
|
||||
endif
|
||||
|
||||
OS ?= $(shell go env GOOS)
|
||||
ARCH ?= $(shell go env GOARCH)
|
||||
FIPS ?=
|
||||
|
|
Loading…
Reference in a new issue