summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/common.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-08-28 00:19:18 +0800
committerGitHub <[email protected]>2022-08-28 00:19:18 +0800
commitdb8df9d14e65c427cd9130280d910f2f60031029 (patch)
tree74cdb84b69c4feffdf81c8fb998d55de3c4ce47b /xmake/rules/c++/modules/modules_support/common.lua
parenteb9a71b929de0c144dad3d137c61297c908440c8 (diff)
parent15617ba485850dd33c2ff8c329a1c24f8631da9f (diff)
Merge pull request #2726 from xmake-io/modules
Improve modules and fix rule/before_build
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/common.lua')
-rw-r--r--xmake/rules/c++/modules/modules_support/common.lua38
1 files changed, 6 insertions, 32 deletions
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