summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-10-15 22:45:02 +0800
committerruki <[email protected]>2021-10-15 22:45:02 +0800
commit4db6d4b4eab1d11a93cd48778c9dc19699d605ce (patch)
tree71ea9ffeff319f036bc29bf15e85b8be60405eae /xmake/rules/c++/modules/xmake.lua
parent4526e745d6283106f46160c629984299e3297ab1 (diff)
fix policy
Diffstat (limited to 'xmake/rules/c++/modules/xmake.lua')
-rw-r--r--xmake/rules/c++/modules/xmake.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua
index 1b99473c0..53a7899d0 100644
--- a/xmake/rules/c++/modules/xmake.lua
+++ b/xmake/rules/c++/modules/xmake.lua
@@ -21,11 +21,12 @@
-- define rule: c++.build.modules
rule("c++.build.modules")
set_extensions(".mpp", ".mxx", ".cppm", ".ixx")
- on_load(function (target)
+ 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
target:set("policy", "build.across_targets_in_parallel", false)
- end)
- before_build_files(function (target, batchjobs, sourcebatch, opt)
+
+ -- build module files with batchjobs
local _, toolname = target:tool("cxx")
if toolname:find("clang", 1, true) then
import("clang").build_with_batchjobs(target, batchjobs, sourcebatch, opt)