summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2022-12-05 17:34:15 +0800
committerGitHub <[email protected]>2022-12-05 17:34:15 +0800
commit47f6bbac08768f792f30e4cd4ff261e8c6645004 (patch)
treec59757de8ca68548ebad0f157d8261c8718ed5ed /xmake/rules/c++/modules
parentc7a49cd9fb1669d8b36634485f38cb5b1edad675 (diff)
parent1eca14c1a39eb899b23cd7560b9a0ea274f1c3e3 (diff)
Merge pull request #3135 from Arthapz/improve-module-installation
add support of prefixdir and installation configuration for modules
Diffstat (limited to 'xmake/rules/c++/modules')
-rw-r--r--xmake/rules/c++/modules/xmake.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua
index 5c90cd3ea..8d48cb0bf 100644
--- a/xmake/rules/c++/modules/xmake.lua
+++ b/xmake/rules/c++/modules/xmake.lua
@@ -141,7 +141,17 @@ rule("c++.build.modules.install")
if common.contains_modules(target) then
local sourcebatch = target:sourcebatches()["c++.build.modules.install"]
if sourcebatch then
- target:add("installfiles", sourcebatch.sourcefiles, {prefixdir = "include"})
+ for _, sourcefile in sourcebatch.sourcefiles do
+ local prefixdir = "modules"
+ local fileconfig = target:fileconfig(sourcefile)
+ if fileconfig and fileconfig.prefixdir then
+ prefixdir = fileconfig.prefixdir
+ end
+ local install = (fileconfig and not fileconfig.install) and false or true
+ if install then
+ target:add("installfiles", sourcefile, {prefixdir = prefixdir})
+ end
+ end
end
end
end)