@@ -199,11 +199,11 @@ function build_modules_for_jobgraph(target, jobgraph, built_modules)
199199 local jobdeps = {}
200200 local buildfilejobs = {}
201201
202- -- if two phase supported only build interface and implementation named modules bmi
202+ -- get named modules
203203 local _built_modules = {}
204204 for _ , sourcefile in ipairs (built_modules ) do
205205 local module = mapper .get (target , sourcefile )
206- if module .interface or module . implementation then
206+ if module .name then
207207 table.insert (_built_modules , sourcefile )
208208 else
209209 if not support .is_bmionly (target , sourcefile ) then
@@ -217,7 +217,6 @@ function build_modules_for_jobgraph(target, jobgraph, built_modules)
217217 end
218218 end
219219 end
220-
221220 -- add module jobs
222221 local moduletype = has_two_phase_compilation_support and " bmi" or " onephase"
223222 local buildgroup = _get_module_buildgroup_for (target , moduletype )
@@ -229,7 +228,7 @@ function build_modules_for_jobgraph(target, jobgraph, built_modules)
229228 table.insert (buildfilejobs , buildfilejob )
230229 jobgraph :add (buildfilejob , function (_ , _ , jobopt )
231230 -- build bmi if named job
232- jobopt .bmi = module .interface or module . implementation
231+ jobopt .bmi = module .name
233232 -- build objectfile here if two phase compilation is not supported
234233 jobopt .objectfile = not has_two_phase_compilation_support and not bmionly
235234 builder .make_module_job (target , module , jobopt )
@@ -271,7 +270,7 @@ function build_objectfiles_for_jobgraph(target, jobgraph, built_modules)
271270 else
272271 for _ , sourcefile in ipairs (built_modules ) do
273272 local module = mapper .get (target , sourcefile )
274- if not module .interface and not module . implementation then
273+ if not module .name then
275274 table.insert (_built_modules , sourcefile )
276275 end
277276 end
@@ -306,11 +305,11 @@ function build_modules_for_batchjobs(target, batchjobs, built_modules, opt)
306305 local builder = _builder (target )
307306 local has_two_phase_compilation_support = support .has_two_phase_compilation_support (target )
308307
309- -- if two phase supported only build interface and implementation named modules bmi
308+ -- if two phase supported only build named modules bmi
310309 local _built_modules = {}
311310 for _ , sourcefile in ipairs (built_modules ) do
312311 local module = mapper .get (target , sourcefile )
313- if module .interface or module . implementation then
312+ if module .name then
314313 table.insert (_built_modules , sourcefile )
315314 end
316315 end
@@ -350,7 +349,7 @@ function build_modules_for_batchjobs(target, batchjobs, built_modules, opt)
350349 sourcefile = module .sourcefile ,
351350 job = batchjobs :newjob (buildfilejob , function (_ , _ , jobopt )
352351 -- build bmi if named job
353- jobopt .bmi = module .interface or module . implementation
352+ jobopt .bmi = module .name
354353 -- build objectfile here if two phase compilation is not supported
355354 jobopt .objectfile = not has_two_phase_compilation_support and not bmionly
356355 builder .make_module_job (target , module , jobopt )
@@ -373,7 +372,7 @@ function build_objectfiles_for_batchjobs(target, batchjobs, built_modules, opt)
373372 else
374373 for _ , sourcefile in ipairs (built_modules ) do
375374 local module = mapper .get (target , sourcefile )
376- if not module .interface and not module . implementation then
375+ if not module .name then
377376 table.insert (_built_modules , sourcefile )
378377 end
379378 end
@@ -410,7 +409,7 @@ function build_modules_for_batchcmds(target, batchcmds, built_modules, opt)
410409 local _built_modules = {}
411410 for _ , sourcefile in ipairs (built_modules ) do
412411 local module = mapper .get (target , sourcefile )
413- if module .interface or module . implementation then
412+ if module .name then
414413 table.insert (_built_modules , sourcefile )
415414 end
416415 end
@@ -419,7 +418,7 @@ function build_modules_for_batchcmds(target, batchcmds, built_modules, opt)
419418 local bmionly = support .is_bmionly (target , sourcefile )
420419 local module = mapper .get (target , sourcefile )
421420 local jobopt = {}
422- jobopt .bmi = module .interface or module . implementation
421+ jobopt .bmi = module .name
423422 jobopt .objectfile = not has_two_phase_compilation_support and not bmionly
424423 jobopt .progress = opt .progress
425424 depmtime = math.max (depmtime , builder .make_module_buildcmds (target , batchcmds , module , jobopt ))
@@ -440,8 +439,8 @@ function build_objectfiles_for_batchcmds(target, batchcmds, built_modules, opt)
440439 else
441440 for _ , sourcefile in ipairs (built_modules ) do
442441 local module = mapper .get (target , sourcefile )
443- if not module .interface and not module . implementation then
444- table.insert (_built_modules , sourcefile )
442+ if not module .name then
443+ table.insert (_built_modules , sourcefile )
445444 end
446445 end
447446 end
659658function build_bmis (target , jobgraph , _ , opt )
660659 opt = opt or {}
661660 if target :data (" cxx.has_modules" ) then
662- if target :is_moduleonly () and not target :data (" cxx.modules.reused" ) then
661+ if target :is_moduleonly () and not target :data (" cxx.modules.reused" ) or target : is_phony () then
663662 return
664663 end
665664 profiler .enter (target :fullname (), " c++ modules" , " builder" , " bmis" )
706705function build_objectfiles (target , jobgraph , _ , opt )
707706
708707 if target :data (" cxx.has_modules" ) then
709- if target :is_moduleonly () and not target :data (" cxx.modules.reused" ) then
708+ if target :is_moduleonly () and not target :data (" cxx.modules.reused" ) or target : is_phony () then
710709 return
711710 end
712711 profiler .enter (target :fullname (), " c++ modules" , " builder" , " objectfiles" )
0 commit comments