summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-08-07 22:01:09 +0800
committerGitHub <[email protected]>2022-08-07 22:01:09 +0800
commit1e47408bfe508f752aaacdcf530cc8fb3747e9df (patch)
tree04899d36b4565ba398c18a7fe9d88aa41c3b3746 /xmake/rules/c++/modules/xmake.lua
parentb0379bcadce0b66fa5d3e5fc45d85a8ba365c92b (diff)
parent1c96d8379173130442227222c75e0caac6afb40b (diff)
Merge pull request #2650 from Arthapz/cxxmodules
Implement module mapper file for MSVC and Clang
Diffstat (limited to 'xmake/rules/c++/modules/xmake.lua')
-rw-r--r--xmake/rules/c++/modules/xmake.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua
index 6d0da85c2..4117004cc 100644
--- a/xmake/rules/c++/modules/xmake.lua
+++ b/xmake/rules/c++/modules/xmake.lua
@@ -93,15 +93,17 @@ rule("c++.build.modules.builder")
local modules = common.generate_dependencies(target, sourcebatch, opt)
-- generate headerunits
- local headerunits_flags = common.generate_headerunits_for_batchcmds(target, batchcmds, sourcebatch, modules, opt)
- if headerunits_flags then
- target:add("cxxflags", headerunits_flags, {force = true, expand = false})
- end
+ common.generate_headerunits_for_batchcmds(target, batchcmds, sourcebatch, modules, opt)
-- build modules
common.build_modules_for_batchcmds(target, batchcmds, sourcebatch, modules, opt)
end)
+ before_link(function(target)
+ import("modules_support.common")
+ common.append_headerunits_objectfiles(target)
+ end)
+
-- install modules
rule("c++.build.modules.install")
set_extensions(".mpp", ".mxx", ".cppm", ".ixx")