summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2022-08-14 11:52:39 +0800
committerruki <[email protected]>2022-08-14 11:52:39 +0800
commitcbf9452ce0bf312b6ddcc4ab4bcdf61553100a3c (patch)
treed54ec2ab7ae9b295c30738fa094052fe61b1de75 /xmake/rules/c++/modules
parent7553abdc8062e4ae45604e03b05986e84221b33c (diff)
fix modules
Diffstat (limited to 'xmake/rules/c++/modules')
-rw-r--r--xmake/rules/c++/modules/modules_support/common.lua5
-rw-r--r--xmake/rules/c++/modules/xmake.lua1
2 files changed, 4 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua
index 0bd1e20d8..aa7c0fb59 100644
--- a/xmake/rules/c++/modules/modules_support/common.lua
+++ b/xmake/rules/c++/modules/modules_support/common.lua
@@ -137,11 +137,12 @@ end
-- this target contains module files?
function contains_modules(target)
- local target_with_modules = target:sourcebatches()["c++.build.modules.builder"] and true or false
+ -- we can not use `"c++.build.modules.builder"`, because it contains sourcekind/cxx.
+ local target_with_modules = target:sourcebatches()["c++.build.modules"] and true or false
if not target_with_modules then
for _, dep in ipairs(target:orderdeps()) do
local sourcebatches = dep:sourcebatches()
- if sourcebatches["c++.build.modules.builder"] then
+ if sourcebatches["c++.build.modules"] then
target_with_modules = true
break
end
diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua
index ae81ebc25..3ef960d7a 100644
--- a/xmake/rules/c++/modules/xmake.lua
+++ b/xmake/rules/c++/modules/xmake.lua
@@ -20,6 +20,7 @@
-- define rule: c++.build.modules
rule("c++.build.modules")
+ set_extensions(".mpp", ".mxx", ".cppm", ".ixx")
add_deps("c++.build.modules.builder")
add_deps("c++.build.modules.install")