diff options
| author | ruki <[email protected]> | 2022-11-28 22:43:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-11-28 22:43:45 +0800 |
| commit | d784affbfbebb5c8a5acafb2d6372a531af007ec (patch) | |
| tree | 02e13d2fb2b50e4edc816464385c32880aa8ca81 /xmake/modules/package/tools | |
| parent | 558557f15b73a6ef4a63bcd0e2f9de8abae76065 (diff) | |
pass build directory to tools/xmake
Diffstat (limited to 'xmake/modules/package/tools')
| -rw-r--r-- | xmake/modules/package/tools/xmake.lua | 10 |
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 |
