diff options
author | Ayke van Laethem <[email protected]> | 2019-05-22 17:11:41 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2019-06-18 16:02:20 +0200 |
commit | fa5855bff5142632b889e4d58cc0386141436b03 (patch) | |
tree | 018ed7c9f6375048e9a7b781e4089cdaf1a16141 | |
parent | 16201c41dc69d4d7896e85653580dee35382fd23 (diff) | |
download | tinygo-fa5855bff5142632b889e4d58cc0386141436b03.tar.gz tinygo-fa5855bff5142632b889e4d58cc0386141436b03.zip |
main: add support for -tags flags
-rw-r--r-- | main.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -53,6 +53,7 @@ type BuildConfig struct { printSizes string cFlags []string ldFlags []string + tags string wasmAbi string testConfig compiler.TestConfig } @@ -92,6 +93,9 @@ func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, act for i := 1; i <= minor; i++ { tags = append(tags, fmt.Sprintf("go1.%d", i)) } + if extraTags := strings.Fields(config.tags); len(extraTags) != 0 { + tags = append(tags, extraTags...) + } compilerConfig := compiler.Config{ Triple: spec.Triple, CPU: spec.CPU, @@ -584,6 +588,7 @@ func main() { printIR := flag.Bool("printir", false, "print LLVM IR") dumpSSA := flag.Bool("dumpssa", false, "dump internal Go SSA") target := flag.String("target", "", "LLVM target") + tags := flag.String("tags", "", "a space-separated list of extra build tags") printSize := flag.String("size", "", "print sizes (none, short, full)") nodebug := flag.Bool("no-debug", false, "disable DWARF debug symbol generation") ocdOutput := flag.Bool("ocd-output", false, "print OCD daemon output during debug") @@ -608,6 +613,7 @@ func main() { dumpSSA: *dumpSSA, debug: !*nodebug, printSizes: *printSize, + tags: *tags, wasmAbi: *wasmAbi, } |