From 031626f8266e7bcced4d0f1f8f7a7cc5c45ba00a Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 15 Oct 2021 22:56:04 +0800 Subject: add generate moduledeps stub --- xmake/rules/c++/modules/xmake.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xmake/rules/c++/modules/xmake.lua') diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index 53a7899d0..0e1e99d5d 100644 --- a/xmake/rules/c++/modules/xmake.lua +++ b/xmake/rules/c++/modules/xmake.lua @@ -21,6 +21,15 @@ -- define rule: c++.build.modules rule("c++.build.modules") set_extensions(".mpp", ".mxx", ".cppm", ".ixx") + before_build(function (target, opt) + local sourcebatches = target:sourcebatches() + if sourcebatches then + local sourcebatch = sourcebatches["c++.build.modules"] + if sourcebatch then + import("moduledeps").generate(target, sourcebatch, opt) + end + end + end) before_build_files(function (target, batchjobs, sourcebatch, opt) -- we disable to build across targets in parallel, because the source files may depend on other target modules -- @note we cannot set it in on_load, because it will affect all c++ projects -- cgit v1.3.1