Add make.go option to build with the race detector.

Change-Id: Ie972bd7ca74e59cbdbf4000ba505473fdd15dc6f
This commit is contained in:
Brad Fitzpatrick 2013-12-11 15:53:36 +04:00
parent 1ade80b0f0
commit 2fde7c11a0
1 changed files with 4 additions and 0 deletions

View File

@ -51,6 +51,7 @@ var (
embedResources = flag.Bool("embed_static", true, "Whether to embed the closure library.")
sqlFlag = flag.String("sqlite", "auto", "Whether you want SQLite in your build: yes, no, or auto.")
all = flag.Bool("all", false, "Force rebuild of everything (go install -a)")
race = flag.Bool("race", false, "Build race-detector version of binaries (they will run slowly)")
verbose = flag.Bool("v", false, "Verbose mode")
targets = flag.String("targets", "", "Optional comma-separated list of targets (i.e go packages) to build and install. Empty means all. Example: camlistore.org/server/camlistored,camlistore.org/cmd/camput")
quiet = flag.Bool("quiet", false, "Don't print anything unless there's a failure.")
@ -205,6 +206,9 @@ func main() {
if *all {
baseArgs = append(baseArgs, "-a")
}
if *race {
baseArgs = append(baseArgs, "-race")
}
baseArgs = append(baseArgs,
"--ldflags=-X camlistore.org/pkg/buildinfo.GitInfo "+version,
"--tags="+tags)