build: separate compiler and libs

This commit is contained in:
Li Jie
2025-01-07 21:49:08 +08:00
parent b0123567cd
commit 1172e5bdce
559 changed files with 190 additions and 176 deletions

View File

@@ -0,0 +1,29 @@
package main
import (
_ "unsafe"
"github.com/goplus/llgo/c"
_ "github.com/goplus/llgo/compiler/cl/internal/linktarget"
)
//go:linkname print github.com/goplus/llgo/compiler/cl/internal/linktarget.F
func print(a, b, c, d *c.Char)
type m struct {
s string
}
//go:linkname setInfo github.com/goplus/llgo/compiler/cl/internal/linktarget.(*m).setInfo
func setInfo(*m, string)
//go:linkname info github.com/goplus/llgo/compiler/cl/internal/linktarget.m.info
func info(m) string
func main() {
print(c.Str("a"), c.Str("b"), c.Str("c"), c.Str("d"))
print(c.Str("1"), c.Str("2"), c.Str("3"), c.Str("4"))
var m m
setInfo(&m, "hello")
println(info(m))
}