summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/install.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-05-11 17:23:04 +0800
committerGitHub <[email protected]>2025-05-11 17:23:04 +0800
commitc357c9bb8bd5c91e33a6453d134720ffd4dec9b1 (patch)
treea7a70f2a1e959ffdac1c62366f8cdc5a47c7c52c /xmake/rules/c++/modules/install.lua
parentd679f86a8f78e8b8c172bdd8d050f0bb72f69864 (diff)
parentfca3c75472f07dc5e6f632e89d283c2cda8acaff (diff)
Merge pull request #6373 from Arthapz/improve-jobgraph-support
(C++ module support) improve jobgraph support
Diffstat (limited to 'xmake/rules/c++/modules/install.lua')
-rw-r--r--xmake/rules/c++/modules/install.lua40
1 files changed, 40 insertions, 0 deletions
diff --git a/xmake/rules/c++/modules/install.lua b/xmake/rules/c++/modules/install.lua
new file mode 100644
index 000000000..0381433a7
--- /dev/null
+++ b/xmake/rules/c++/modules/install.lua
@@ -0,0 +1,40 @@
+--!A cross-platform build utility based on Lua
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+-- Copyright (C) 2015-present, TBOOX Open Source Group.
+--
+-- @author ruki, Arthapz
+-- @file install.lua
+--
+
+import("support")
+import("scanner")
+import("builder")
+
+function install(target)
+ -- we cannot use target:data("cxx.has_modules"),
+ -- because on_config will be not called when installing targets
+ if support.contains_modules(target) then
+ local modules = scanner.get_modules(target)
+ builder.generate_metadata(target, modules)
+ support.add_installfiles_for_modules(target, modules)
+ end
+end
+
+function uninstall(target)
+ if support.contains_modules(target) then
+ local modules = scanner.get_modules(target)
+ support.add_installfiles_for_modules(target, modules)
+ end
+end