cl: switch debug symbols with LLGO_DEBUG

This commit is contained in:
Li Jie
2024-09-21 21:09:16 +08:00
parent 88b980ac17
commit dad22b1686
11 changed files with 43 additions and 68 deletions

View File

@@ -17,24 +17,19 @@
package main
import (
"flag"
"fmt"
"os"
"github.com/goplus/llgo/internal/build"
"github.com/goplus/llgo/internal/llgen"
)
var (
enableDbg = flag.Bool("dbg", false, "enable debug symbols")
)
func main() {
flag.Parse()
if len(flag.Args()) < 1 {
if len(os.Args) < 2 {
fmt.Fprintln(os.Stderr, "Usage: llgen [flags] <pkg> [pkgPath]")
return
}
llgen.Init(*enableDbg)
args := flag.Args()
llgen.Init(build.IsDebugEnabled())
args := os.Args[1:]
llgen.SmartDoFile(args[0], args[1:]...)
}