compiler: build separation runtime with clite

This commit is contained in:
Li Jie
2025-01-07 22:16:31 +08:00
parent 1172e5bdce
commit 6170973b48
316 changed files with 71331 additions and 178 deletions

View File

@@ -191,8 +191,8 @@ func Do(args []string, conf *Config) ([]Package, error) {
// updates. Since `github.com/goplus/llgo/c/*` contains many application libraries
// that may change frequently, a possible solution is to have both depend on a
// stable and limited c core API.
if !llgoPkgImported(initial) {
cfg.Dir = env.LLGoROOT()
if !llgoRuntimeImported(initial) {
cfg.Dir = env.LLGoRuntimeDir()
}
altPkgs, err := packages.LoadEx(dedup, sizes, cfg, altPkgPaths...)
check(err)
@@ -251,10 +251,10 @@ func Do(args []string, conf *Config) ([]Package, error) {
return dpkg, nil
}
func llgoPkgImported(pkgs []*packages.Package) bool {
func llgoRuntimeImported(pkgs []*packages.Package) bool {
for _, pkg := range pkgs {
for _, imp := range pkg.Imports {
if imp.Module != nil && imp.Module.Path == env.LLGoCompilerPkg {
if imp.Module != nil && imp.Module.Path == env.LLGoRuntimePkg {
return true
}
}