refine internal/clang: don't depends internal/crosscompile

This commit is contained in:
Li Jie
2025-08-22 09:08:26 +08:00
parent 3ce63965bf
commit 1f193c8533
2 changed files with 72 additions and 39 deletions

View File

@@ -389,13 +389,27 @@ type context struct {
}
func (c *context) compiler() *clang.Cmd {
cmd := clang.NewCompiler(c.crossCompile)
config := clang.NewConfig(
c.crossCompile.CC,
c.crossCompile.CCFLAGS,
c.crossCompile.CFLAGS,
c.crossCompile.LDFLAGS,
c.crossCompile.Linker,
)
cmd := clang.NewCompiler(config)
cmd.Verbose = c.buildConf.Verbose
return cmd
}
func (c *context) linker() *clang.Cmd {
cmd := clang.NewLinker(c.crossCompile)
config := clang.NewConfig(
c.crossCompile.CC,
c.crossCompile.CCFLAGS,
c.crossCompile.CFLAGS,
c.crossCompile.LDFLAGS,
c.crossCompile.Linker,
)
cmd := clang.NewLinker(config)
cmd.Verbose = c.buildConf.Verbose
return cmd
}