diff --git a/vlib/v/builder/cc.v b/vlib/v/builder/cc.v index afe307c9c6..ade2374616 100644 --- a/vlib/v/builder/cc.v +++ b/vlib/v/builder/cc.v @@ -341,7 +341,12 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) { ccoptions.post_args << '-municode' } cflags := v.get_os_cflags() - ccoptions.o_args << cflags.c_options_only_object_files() + + if v.pref.build_mode != .build_module { + only_o_files := cflags.c_options_only_object_files() + ccoptions.o_args << only_o_files + } + defines, others, libs := cflags.defines_others_libs() ccoptions.pre_args << defines ccoptions.pre_args << others