fix build flags for debugging

This commit is contained in:
Roy Crihfield 2022-05-13 18:48:39 +08:00
parent 9de27fb24f
commit 4040c3425f

View File

@ -88,23 +88,22 @@ ifeq (boltdb,$(findstring boltdb,$(COSMOS_BUILD_OPTIONS)))
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=boltdb ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=boltdb
endif endif
BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'
# Check for debug option
ifeq (debug,$(findstring debug,$(COSMOS_BUILD_OPTIONS)))
BUILD_FLAGS += -gcflags 'all=-N -l'
COSMOS_BUILD_OPTIONS += nostrip
endif
# check for nostrip option
ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS))) ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS)))
BUILD_FLAGS += -trimpath
ldflags += -w -s ldflags += -w -s
endif endif
ldflags += $(LDFLAGS) ldflags += $(LDFLAGS)
ldflags := $(strip $(ldflags)) ldflags := $(strip $(ldflags))
BUILD_FLAGS := -tags "$(build_tags)" -ldflags '$(ldflags)'
# check for nostrip option
ifeq (,$(findstring nostrip,$(COSMOS_BUILD_OPTIONS)))
BUILD_FLAGS += -trimpath
endif
# Check for debug option
ifeq (debug,$(findstring debug,$(COSMOS_BUILD_OPTIONS)))
BUILD_FLAGS += -gcflags "all=-N -l"
endif
all: tools build lint test all: tools build lint test
# # The below include contains the tools and runsim targets. # # The below include contains the tools and runsim targets.
# include contrib/devtools/Makefile # include contrib/devtools/Makefile