add force-espclang to force using esp-clang for dev mode

This commit is contained in:
Li Jie
2025-08-24 17:25:25 +08:00
parent ca30338066
commit 11e1348a2c
2 changed files with 5 additions and 1 deletions

View File

@@ -86,6 +86,7 @@ type Config struct {
GenLL bool // generate pkg .ll files
CheckLLFiles bool // check .ll files valid
CheckLinkArgs bool // check linkargs valid
ForceEspClang bool // force to use esp-clang
Tags string
GlobalNames map[string][]string // pkg => names
GlobalDatas map[string]string // pkg.name => data
@@ -159,7 +160,7 @@ func Do(args []string, conf *Config) ([]Package, error) {
conf.Goarch = runtime.GOARCH
}
// Handle crosscompile configuration first to set correct GOOS/GOARCH
forceEspClang := conf.Target != ""
forceEspClang := conf.ForceEspClang || conf.Target != ""
export, err := crosscompile.Use(conf.Goos, conf.Goarch, conf.Target, IsWasiThreadsEnabled(), forceEspClang)
if err != nil {
return nil, fmt.Errorf("failed to setup crosscompile: %w", err)