diff options
author | Ayke van Laethem <[email protected]> | 2019-10-31 15:39:01 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2019-11-04 11:45:35 +0100 |
commit | e7cf75030c6fe8a21ace88be690241f7b16f998d (patch) | |
tree | e891d0fd9e635e6060d9330b23530418fe281598 /main.go | |
parent | dff6e6566db6e42ade2b5007796de8474535c410 (diff) | |
download | tinygo-e7cf75030c6fe8a21ace88be690241f7b16f998d.tar.gz tinygo-e7cf75030c6fe8a21ace88be690241f7b16f998d.zip |
main: move target specification into a separate package
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -17,6 +17,7 @@ import ( "syscall" "time" + "github.com/tinygo-org/tinygo/compileopts" "github.com/tinygo-org/tinygo/compiler" "github.com/tinygo-org/tinygo/goenv" "github.com/tinygo-org/tinygo/interp" @@ -66,7 +67,7 @@ type BuildConfig struct { } // Helper function for Compiler object. -func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, action func(string) error) error { +func Compile(pkgName, outpath string, spec *compileopts.TargetSpec, config *BuildConfig, action func(string) error) error { if config.gc == "" && spec.GC != "" { config.gc = spec.GC } @@ -335,7 +336,7 @@ func Compile(pkgName, outpath string, spec *TargetSpec, config *BuildConfig, act } func Build(pkgName, outpath, target string, config *BuildConfig) error { - spec, err := LoadTarget(target) + spec, err := compileopts.LoadTarget(target) if err != nil { return err } @@ -369,7 +370,7 @@ func Build(pkgName, outpath, target string, config *BuildConfig) error { } func Test(pkgName, target string, config *BuildConfig) error { - spec, err := LoadTarget(target) + spec, err := compileopts.LoadTarget(target) if err != nil { return err } @@ -396,7 +397,7 @@ func Test(pkgName, target string, config *BuildConfig) error { } func Flash(pkgName, target, port string, config *BuildConfig) error { - spec, err := LoadTarget(target) + spec, err := compileopts.LoadTarget(target) if err != nil { return err } @@ -503,7 +504,7 @@ func Flash(pkgName, target, port string, config *BuildConfig) error { // Note: this command is expected to execute just before exiting, as it // modifies global state. func FlashGDB(pkgName, target, port string, ocdOutput bool, config *BuildConfig) error { - spec, err := LoadTarget(target) + spec, err := compileopts.LoadTarget(target) if err != nil { return err } @@ -594,7 +595,7 @@ func FlashGDB(pkgName, target, port string, ocdOutput bool, config *BuildConfig) // Compile and run the given program, directly or in an emulator. func Run(pkgName, target string, config *BuildConfig) error { - spec, err := LoadTarget(target) + spec, err := compileopts.LoadTarget(target) if err != nil { return err } |