diff options
Diffstat (limited to 'xmake/modules/package/tools/make.lua')
| -rw-r--r-- | xmake/modules/package/tools/make.lua | 22 |
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 |
