summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/make.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-05-10 00:00:04 +0800
committerruki <[email protected]>2019-05-09 18:00:29 +0800
commit6f3d4c780f2bb0f7334f808f70189e98d0d9e49c (patch)
tree264bc21c651b3dda034f597cbcd7fcbdf9e91970 /xmake/modules/package/tools/make.lua
parent7046db617540375af75ee3da1009f9a702fe1675 (diff)
add tools/make.build
Diffstat (limited to 'xmake/modules/package/tools/make.lua')
-rw-r--r--xmake/modules/package/tools/make.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/make.lua b/xmake/modules/package/tools/make.lua
index 65cdcd968..13e72b310 100644
--- a/xmake/modules/package/tools/make.lua
+++ b/xmake/modules/package/tools/make.lua
@@ -64,3 +64,25 @@ function buildenvs(package)
return envs
end
+-- build package
+function build(package, configs, opt)
+
+ -- init options
+ opt = opt or {}
+
+ -- pass configurations
+ local argv = {"-j4"}
+ for name, value in pairs(configs) do
+ value = tostring(value):trim()
+ if value ~= "" then
+ if type(name) == "number" then
+ table.insert(argv, value)
+ else
+ table.insert(argv, name .. "=" .. value)
+ end
+ end
+ end
+
+ -- do configure
+ os.vrunv("make", argv, {envs = opt.envs or buildenvs(package)})
+end