From e192f01dc310e61382e7a24eb3b78538a77e9428 Mon Sep 17 00:00:00 2001 From: visualfc Date: Thu, 11 Jul 2024 11:37:55 +0800 Subject: [PATCH] build: fix buildpkg --- internal/build/build.go | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/internal/build/build.go b/internal/build/build.go index b920cfcf..51e2f00e 100644 --- a/internal/build/build.go +++ b/internal/build/build.go @@ -254,7 +254,7 @@ func buildAllPkgs(ctx *context, initial []*packages.Package, verbose bool) (pkgs cl.ParsePkgSyntax(ctx.prog, pkg.Types, pkg.Syntax) pkg.ExportFile = "" case cl.PkgLinkIR, cl.PkgLinkExtern, cl.PkgPyModule: - if isPkgInLLGo(pkg.PkgPath) { + if len(pkg.GoFiles) > 0 { buildPkg(ctx, aPkg, verbose) pkg.ExportFile = " " + concatPkgLinkFiles(pkg, verbose) + " " + pkg.ExportFile } else { @@ -648,22 +648,6 @@ func clFile(cFile, expFile string, procFile func(linkFile string), verbose bool) procFile(llFile) } -const ( - llgoModPath = "github.com/goplus/llgo" -) - -func isPkgInLLGo(pkgPath string) bool { - return isPkgInMod(pkgPath, llgoModPath) -} - -func isPkgInMod(pkgPath, modPath string) bool { - if strings.HasPrefix(pkgPath, modPath) { - suffix := pkgPath[len(modPath):] - return suffix == "" || suffix[0] == '/' - } - return false -} - func pkgExists(initial []*packages.Package, pkg *packages.Package) bool { for _, v := range initial { if v == pkg {