@@ -191,11 +191,11 @@ function build_modules_for_jobgraph(target, jobgraph, built_modules)
191191 local jobdeps = {}
192192 local buildfilejobs = {}
193193
194- -- if two phase supported only build interface and implementation named modules bmi
194+ -- get named modules
195195 local _built_modules = {}
196196 for _ , sourcefile in ipairs (built_modules ) do
197197 local module = mapper .get (target , sourcefile )
198- if module .interface or module . implementation then
198+ if module .name then
199199 table.insert (_built_modules , sourcefile )
200200 else
201201 if not support .is_bmionly (target , sourcefile ) then
@@ -209,7 +209,6 @@ function build_modules_for_jobgraph(target, jobgraph, built_modules)
209209 end
210210 end
211211 end
212-
213212 -- add module jobs
214213 local moduletype = has_two_phase_compilation_support and " bmi" or " onephase"
215214 local buildgroup = _get_module_buildgroup_for (target , moduletype )
@@ -221,7 +220,7 @@ function build_modules_for_jobgraph(target, jobgraph, built_modules)
221220 table.insert (buildfilejobs , buildfilejob )
222221 jobgraph :add (buildfilejob , function (_ , _ , jobopt )
223222 -- build bmi if named job
224- jobopt .bmi = module .interface or module . implementation
223+ jobopt .bmi = module .name
225224 -- build objectfile here if two phase compilation is not supported
226225 jobopt .objectfile = not has_two_phase_compilation_support and not bmionly
227226 builder .make_module_job (target , module , jobopt )
@@ -261,7 +260,7 @@ function build_objectfiles_for_jobgraph(target, jobgraph, built_modules)
261260 else
262261 for _ , sourcefile in ipairs (built_modules ) do
263262 local module = mapper .get (target , sourcefile )
264- if not module .interface and not module . implementation then
263+ if not module .name then
265264 table.insert (_built_modules , sourcefile )
266265 end
267266 end
@@ -295,11 +294,11 @@ function build_modules_for_batchjobs(target, batchjobs, built_modules, opt)
295294 local builder = _builder (target )
296295 local has_two_phase_compilation_support = support .has_two_phase_compilation_support (target )
297296
298- -- if two phase supported only build interface and implementation named modules bmi
297+ -- if two phase supported only build named modules bmi
299298 local _built_modules = {}
300299 for _ , sourcefile in ipairs (built_modules ) do
301300 local module = mapper .get (target , sourcefile )
302- if module .interface or module . implementation then
301+ if module .name then
303302 table.insert (_built_modules , sourcefile )
304303 end
305304 end
@@ -339,7 +338,7 @@ function build_modules_for_batchjobs(target, batchjobs, built_modules, opt)
339338 sourcefile = module .sourcefile ,
340339 job = batchjobs :newjob (buildfilejob , function (_ , _ , jobopt )
341340 -- build bmi if named job
342- jobopt .bmi = module .interface or module . implementation
341+ jobopt .bmi = module .name
343342 -- build objectfile here if two phase compilation is not supported
344343 jobopt .objectfile = not has_two_phase_compilation_support and not bmionly
345344 builder .make_module_job (target , module , jobopt )
@@ -362,7 +361,7 @@ function build_objectfiles_for_batchjobs(target, batchjobs, built_modules, opt)
362361 else
363362 for _ , sourcefile in ipairs (built_modules ) do
364363 local module = mapper .get (target , sourcefile )
365- if not module .interface and not module . implementation then
364+ if not module .name then
366365 table.insert (_built_modules , sourcefile )
367366 end
368367 end
@@ -399,7 +398,7 @@ function build_modules_for_batchcmds(target, batchcmds, built_modules, opt)
399398 local _built_modules = {}
400399 for _ , sourcefile in ipairs (built_modules ) do
401400 local module = mapper .get (target , sourcefile )
402- if module .interface or module . implementation then
401+ if module .name then
403402 table.insert (_built_modules , sourcefile )
404403 end
405404 end
@@ -408,7 +407,7 @@ function build_modules_for_batchcmds(target, batchcmds, built_modules, opt)
408407 local bmionly = support .is_bmionly (target , sourcefile )
409408 local module = mapper .get (target , sourcefile )
410409 local jobopt = {}
411- jobopt .bmi = module .interface or module . implementation
410+ jobopt .bmi = module .name
412411 jobopt .objectfile = not has_two_phase_compilation_support and not bmionly
413412 jobopt .progress = opt .progress
414413 depmtime = math.max (depmtime , builder .make_module_buildcmds (target , batchcmds , module , jobopt ))
@@ -429,8 +428,8 @@ function build_objectfiles_for_batchcmds(target, batchcmds, built_modules, opt)
429428 else
430429 for _ , sourcefile in ipairs (built_modules ) do
431430 local module = mapper .get (target , sourcefile )
432- if not module .interface and not module . implementation then
433- table.insert (_built_modules , sourcefile )
431+ if not module .name then
432+ table.insert (_built_modules , sourcefile )
434433 end
435434 end
436435 end
641640function build_bmis (target , jobgraph , _ , opt )
642641 opt = opt or {}
643642 if target :data (" cxx.has_modules" ) then
644- if target :is_moduleonly () and not target :data (" cxx.modules.reused" ) then
643+ if target :is_moduleonly () and not target :data (" cxx.modules.reused" ) or target : is_phony () then
645644 return
646645 end
647646 local modules = scanner .get_modules (target )
686685function build_objectfiles (target , jobgraph , _ , opt )
687686
688687 if target :data (" cxx.has_modules" ) then
689- if target :is_moduleonly () and not target :data (" cxx.modules.reused" ) then
688+ if target :is_moduleonly () and not target :data (" cxx.modules.reused" ) or target : is_phony () then
690689 return
691690 end
692691 local modules = scanner .get_modules (target )
0 commit comments