cgen: fix module builds when -usecache is on by default
parent
4b45f2eaab
commit
3b2083801b
|
@ -969,7 +969,7 @@ fn (mut g Gen) stmt(node ast.Stmt) {
|
|||
println('build module `$g.module_built` fn `$node.name`')
|
||||
}
|
||||
}
|
||||
if g.pref.use_cache {
|
||||
if g.pref.use_cache && g.pref.build_mode != .build_module {
|
||||
// We are using prebuilt modules, we do not need to generate
|
||||
// their functions in main.c.
|
||||
if node.mod != 'main' && node.mod != 'help' && !should_bundle_module {
|
||||
|
|
|
@ -113,7 +113,7 @@ fn (mut g Gen) gen_fn_decl(it ast.FnDecl, skip bool) {
|
|||
arg_start_pos := g.out.len
|
||||
fargs, fargtypes := g.fn_args(it.params, it.is_variadic)
|
||||
arg_str := g.out.after(arg_start_pos)
|
||||
if it.no_body || (g.pref.use_cache && it.is_builtin) || skip {
|
||||
if it.no_body || ((g.pref.use_cache && g.pref.build_mode != .build_module) && it.is_builtin) || skip {
|
||||
// Just a function header. Builtin function bodies are defined in builtin.o
|
||||
g.definitions.writeln(');') // // NO BODY')
|
||||
g.writeln(');')
|
||||
|
|
Loading…
Reference in New Issue