aboutsummaryrefslogtreecommitdiffhomepage
path: root/compileopts/target.go
diff options
context:
space:
mode:
authorTobias Theel <[email protected]>2021-03-27 01:54:09 +0100
committerRon Evans <[email protected]>2021-03-29 09:35:19 +0200
commit4be9802d26e292f1f0408742d3cbb7b25ef91291 (patch)
tree068c9a277ed5a5160438f22fbcce022789fef32e /compileopts/target.go
parent90b42799a2a91f6614ea86e8650d5fa303bc10b2 (diff)
downloadtinygo-4be9802d26e292f1f0408742d3cbb7b25ef91291.tar.gz
tinygo-4be9802d26e292f1f0408742d3cbb7b25ef91291.zip
throw an error on windows builds with no target specified
Diffstat (limited to 'compileopts/target.go')
-rw-r--r--compileopts/target.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/compileopts/target.go b/compileopts/target.go
index acff0e023..fc0b70184 100644
--- a/compileopts/target.go
+++ b/compileopts/target.go
@@ -230,7 +230,13 @@ func LoadTarget(target string) (*TargetSpec, error) {
}
}
+// WindowsBuildNotSupportedErr is being thrown, when goos is windows and no target has been specified.
+var WindowsBuildNotSupportedErr = errors.New("Building Windows binaries is currently not supported. Try specifying a different target")
+
func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
+ if goos == "windows" {
+ return nil, WindowsBuildNotSupportedErr
+ }
// No target spec available. Use the default one, useful on most systems
// with a regular OS.
spec := TargetSpec{