build: support multiple link files in a package

This commit is contained in:
xushiwei
2024-05-08 18:57:14 +08:00
parent b0b38c02b2
commit 879e4a0061
11 changed files with 164 additions and 42 deletions

View File

@@ -123,7 +123,8 @@ const (
PkgLLGo
PkgNoInit // noinit: a package that don't need to be initialized
PkgDeclOnly // decl: a package that only have declarations
PkgLinkOnly // link: a package that don't need to be compiled but need to be linked
PkgLinkIR // link llvm ir (.ll)
// PkgLinkBitCode // link bitcode (.bc)
)
type pkgInfo struct {

View File

@@ -91,7 +91,9 @@ func PkgKindOf(pkg *types.Package) int {
func pkgKind(v string) int {
switch v {
case "link":
return PkgLinkOnly
return PkgLinkIR
// case "link:bc":
// return PkgLinkBitCode
case "decl":
return PkgDeclOnly
case "noinit":