summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
-rw-r--r--xmake/rules/c++/modules/modules_support/clang.lua2
-rw-r--r--xmake/rules/c++/modules/modules_support/common.lua38
-rw-r--r--xmake/rules/c++/modules/modules_support/msvc.lua12
3 files changed, 9 insertions, 43 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua
index fb3a2d1fa..ea11cbe1c 100644
--- a/xmake/rules/c++/modules/modules_support/clang.lua
+++ b/xmake/rules/c++/modules/modules_support/clang.lua
@@ -153,7 +153,7 @@ function generate_dependencies(target, sourcebatch, opt)
changed = true
local dependinfo = io.readfile(jsonfile)
- return { moduleinfo = dependinfo }
+ return {moduleinfo = dependinfo}
end, {dependfile = dependfile, files = {sourcefile}})
end
return changed
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua
index 92c92d465..ae1b1ca9e 100644
--- a/xmake/rules/c++/modules/modules_support/common.lua
+++ b/xmake/rules/c++/modules/modules_support/common.lua
@@ -459,41 +459,15 @@ function get_module_dependencies(target, sourcebatch, opt)
return modules
end
--- generate headerunits for batchjobs
-function generate_headerunits_for_batchjobs(target, batchjobs, sourcebatch, modules, opt)
-
- -- get headerunits info
- local headerunits, stl_headerunits = get_headerunits(target, sourcebatch, modules)
-
- -- generate headerunits
- -- build stl header units as other headerunits may need them
- local headerunits_flags
- if stl_headerunits then
- headerunits_flags = headerunits_flags or {}
- table.join2(headerunits_flags, modules_support(target).generate_stl_headerunits_for_batchjobs(target, batchjobs, stl_headerunits, opt))
- end
- if headerunits then
- headerunits_flags = headerunits_flags or {}
- table.join2(headerunits_flags, modules_support(target).generate_user_headerunits_for_batchjobs(target, batchjobs, headerunits, opt))
- end
- return headerunits_flags
-end
-
-- generate headerunits for batchcmds
function generate_headerunits_for_batchcmds(target, batchcmds, sourcebatch, modules, opt)
-
- -- get headerunits info
local user_headerunits, stl_headerunits = get_headerunits(target, sourcebatch, modules)
-
- -- generate headerunits
-- build stl header units as other headerunits may need them
- if stl_headerunits or user_headerunits then
- if stl_headerunits then
- modules_support(target).generate_stl_headerunits_for_batchcmds(target, batchcmds, stl_headerunits, opt)
- end
- if user_headerunits then
- modules_support(target).generate_user_headerunits_for_batchcmds(target, batchcmds, user_headerunits, opt)
- end
+ if stl_headerunits then
+ modules_support(target).generate_stl_headerunits_for_batchcmds(target, batchcmds, stl_headerunits, opt)
+ end
+ if user_headerunits then
+ modules_support(target).generate_user_headerunits_for_batchcmds(target, batchcmds, user_headerunits, opt)
end
end
@@ -553,7 +527,7 @@ end
function append_dependency_objectfiles(target)
local cachekey = target:name() .. "dependency_objectfiles"
local cache = localcache():get(cachekey)
- if cache then
+ if cache then
if target:is_binary() then
target:add("ldflags", cache, {force = true})
elseif target:is_static() then
diff --git a/xmake/rules/c++/modules/modules_support/msvc.lua b/xmake/rules/c++/modules/modules_support/msvc.lua
index f7dc7451c..4439a578e 100644
--- a/xmake/rules/c++/modules/modules_support/msvc.lua
+++ b/xmake/rules/c++/modules/modules_support/msvc.lua
@@ -154,7 +154,7 @@ end
-- generate header unit module bmi for batchjobs
function generate_headerunit_for_batchjob(target, name, flags, objectfile, index, total)
-- don't generate same header unit bmi at the same time across targets
- if not common.memcache():get2(name, "generating") then
+ if not common.memcache():get2(name, "generating") then
local compinst = target:compiler("cxx")
local toolchain = target:toolchain("msvc")
local vcvars = toolchain:config("vcvars")
@@ -234,7 +234,7 @@ function generate_stl_headerunits_for_batchcmds(target, batchcmds, headerunits,
local bmifile = path.join(stlcachedir, headerunit.name .. get_bmi_extension())
local objectfile = bmifile .. ".obj"
local flags = {
- exportheaderflag,
+ exportheaderflag,
headernameflag .. ":angle",
headerunit.name,
ifcoutputflag,
@@ -429,14 +429,6 @@ function build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, op
deps = table.keys(module.requires),
sourcefile = module.cppfile,
job = batchjobs:newjob(module.cppfile, function(index, total)
- function contains(t, v)
- for _, flag in ipairs(t) do
- if table.contains(flag, v) then
- return true
- end
- end
- return false
- end
-- append module mapper flags
-- @note we add it at the end to ensure that the full modulemap are already stored in the mapper
local requiresflags = get_requiresflags(target, module.requires)