summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/package/tools/xmake.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua
index 1c74a6851..e98107215 100644
--- a/xmake/modules/package/tools/xmake.lua
+++ b/xmake/modules/package/tools/xmake.lua
@@ -37,7 +37,8 @@ function _get_config_from_toolchains(package, name)
end
-- get configs
-function _get_configs(package, configs)
+function _get_configs(package, configs, opt)
+ opt = opt or {}
local configs = configs or {}
local cflags = table.join(table.wrap(package:config("cflags")), get_config("cflags"))
local cxflags = table.join(table.wrap(package:config("cxflags")), get_config("cxflags"))
@@ -135,6 +136,11 @@ function _get_configs(package, configs)
if ldflags and #ldflags > 0 then
table.insert(configs, "--ldflags=" .. table.concat(ldflags, ' '))
end
+ local buildir = opt.buildir or package:buildir()
+ if buildir then
+ table.insert(configs, "-o")
+ table.insert(configs, buildir)
+ end
return configs
end
@@ -255,7 +261,7 @@ function install(package, configs, opt)
_set_builtin_argv(argv)
table.insert(argv, "-y")
table.insert(argv, "-c")
- for name, value in pairs(_get_configs(package, configs)) do
+ for name, value in pairs(_get_configs(package, configs, opt)) do
value = tostring(value):trim()
if type(name) == "number" then
if value ~= "" then