Skip to content

Commit 9bd198b

Browse files
committed
define flag and env to enable NoCompatibility option
Signed-off-by: sivchari <shibuuuu5@gmail.com>
1 parent a766aca commit 9bd198b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,6 +1635,7 @@ func main() {
16351635
cpuprofile := flag.String("cpuprofile", "", "cpuprofile output")
16361636
monitor := flag.Bool("monitor", false, "enable serial monitor")
16371637
baudrate := flag.Int("baudrate", 115200, "baudrate of serial monitor")
1638+
nocompatibility := flag.Bool("no-compatibility", false, "do not check Go version compatibility, you can also set the TINYGONOCOMPATIBILITY environment variable to enable this")
16381639

16391640
// Internal flags, that are only intended for TinyGo development.
16401641
printIR := flag.Bool("internal-printir", false, "print LLVM IR")
@@ -1712,6 +1713,11 @@ func main() {
17121713
ocdCommands = strings.Split(*ocdCommandsString, ",")
17131714
}
17141715

1716+
if !*nocompatibility {
1717+
_, ok := os.LookupEnv("TINYGONOCOMPATIBILITY")
1718+
*nocompatibility = ok
1719+
}
1720+
17151721
options := &compileopts.Options{
17161722
GOOS: goenv.Get("GOOS"),
17171723
GOARCH: goenv.Get("GOARCH"),
@@ -1748,6 +1754,7 @@ func main() {
17481754
Timeout: *timeout,
17491755
WITPackage: witPackage,
17501756
WITWorld: witWorld,
1757+
NoCompatibility: *nocompatibility,
17511758
}
17521759
if *printCommands {
17531760
options.PrintCommands = printCommand

0 commit comments

Comments
 (0)