5353
5454function _compile_one_step (target , module , opt )
5555 -- get flags
56+ local module_outputflag = support .get_moduleoutputflag (target )
5657 if module_outputflag then
5758 local flags = _make_modulebuildflags (target , module , {bmi = true , objectfile = true })
5859 if opt and opt .batchcmds then
@@ -101,7 +102,7 @@ function _compile(target, flags, sourcefile, outputfile, opt)
101102 local dryrun = option .get (" dry-run" )
102103 local compinst = target :compiler (" cxx" )
103104 local compflags = compinst :compflags ({sourcefile = sourcefile , target = target , sourcekind = " cxx" })
104- flags = table .join (flags or {}, compflags or {})
105+ flags = table .join (compflags or {}, flags or {})
105106
106107 local bmifile = opt and opt .bmifile
107108
@@ -122,7 +123,7 @@ function _batchcmds_compile(batchcmds, target, flags, sourcefile, outputfile, op
122123 opt = opt or {}
123124 local compinst = target :compiler (" cxx" )
124125 local compflags = compinst :compflags ({sourcefile = sourcefile , target = target , sourcekind = " cxx" })
125- flags = table .join (" -c" , compflags or {}, flags , {" -o" , outputfile , opt .bmifile or sourcefile })
126+ flags = table .join (" -c" , compflags or {}, flags or {} , {" -o" , outputfile , opt .bmifile or sourcefile })
126127 batchcmds :compilev (flags , {compiler = compinst , sourcekind = " cxx" })
127128end
128129
0 commit comments