Skip to content

Commit

Permalink
makefile: Enable -race with WITH_RACE=1 (pingcap#3399)
Browse files Browse the repository at this point in the history
  • Loading branch information
shenli authored and tiancaiamao committed Jun 7, 2017
1 parent 7d634a5 commit 5a1154d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,17 @@ race: parserlib
tikv_integration_test: parserlib
$(GOTEST) ./store/tikv/. -with-tikv=true

RACE_FLAG =
ifeq ("$(WITH_RACE)", "1")
RACE_FLAG = -race
GOBUILD = GOPATH=$(CURDIR)/_vendor:$(GOPATH) CGO_ENABLED=1 $(GO) build
endif

server: parserlib
ifeq ($(TARGET), "")
$(GOBUILD) -ldflags '$(LDFLAGS)' -o bin/tidb-server tidb-server/main.go
$(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS)' -o bin/tidb-server tidb-server/main.go
else
$(GOBUILD) -ldflags '$(LDFLAGS)' -o '$(TARGET)' tidb-server/main.go
$(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS)' -o '$(TARGET)' tidb-server/main.go
endif

benchkv:
Expand Down

0 comments on commit 5a1154d

Please sign in to comment.