summaryrefslogtreecommitdiff
path: root/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2022-02-09 00:49:27 +0800
committerruki <[email protected]>2022-02-09 00:49:27 +0800
commit60674942ef4c5139a2b86a9625e352f8bb1d6ec8 (patch)
tree2e8edc6560bec4630d3baae586110316eb18712d /xmake
parent12849536a491932f2fac1e34d57216e04c047d06 (diff)
update changelog
Diffstat (limited to 'xmake')
-rw-r--r--xmake/modules/private/xrepo/action/install.lua19
1 files changed, 18 insertions, 1 deletions
diff --git a/xmake/modules/private/xrepo/action/install.lua b/xmake/modules/private/xrepo/action/install.lua
index 691b3b09c..6d36e5a92 100644
--- a/xmake/modules/private/xrepo/action/install.lua
+++ b/xmake/modules/private/xrepo/action/install.lua
@@ -107,6 +107,21 @@ function _install_packages(packages)
os.cd(workdir)
end
+ -- is package configuration file? e.g. xrepo install xxx.lua
+ --
+ -- xxx.lua
+ -- add_requires("libpng", {system = false})
+ -- add_requireconfs("libpng.*", {configs = {shared = true}})
+ local filemode = false
+ if type(packages) == "string" or #packages == 1 then
+ local packagefile = table.unwrap(packages)
+ if type(packagefile) == "string" and packagefile:endswith(".lua") and os.isfile(packagefile) then
+ assert(os.isfile("xmake.lua"), "xmake.lua not found!")
+ os.cp(packagefile, "xmake.lua")
+ filemode = true
+ end
+ end
+
-- disable xmake-stats
os.setenv("XMAKE_STATS", "false")
@@ -224,7 +239,9 @@ function _install_packages(packages)
local extra_str = string.serialize(extra, {indent = false, strip = true})
table.insert(require_argv, "--extra=" .. extra_str)
end
- table.join2(require_argv, packages)
+ if not filemode then
+ table.join2(require_argv, packages)
+ end
os.vexecv("xmake", require_argv, {envs = envs})
end