Skip to content

Commit ba1e2a5

Browse files
committed
feat: improve GN tool for build/install commands
- rename option from argv to target, follows usage of ninja. - add option in install command.
1 parent 39a7e8b commit ba1e2a5

File tree

1 file changed

+4
-3
lines changed
  • xmake/modules/package/tools

1 file changed

+4
-3
lines changed

xmake/modules/package/tools/gn.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ function build(package, configs, opt)
124124

125125
-- do build
126126
local buildir = _get_buildir(opt)
127-
local argv = opt.argv or {}
128-
ninja.build(package, argv, {buildir = buildir, envs = opt.envs or buildenvs(package, opt)})
127+
local targets = table.wrap(opt.target)
128+
ninja.build(package, targets, {buildir = buildir, envs = opt.envs or buildenvs(package, opt)})
129129
end
130130

131131
-- install package
@@ -137,5 +137,6 @@ function install(package, configs, opt)
137137

138138
-- do build and install
139139
local buildir = _get_buildir(opt)
140-
ninja.install(package, {}, {buildir = buildir, envs = opt.envs or buildenvs(package, opt)})
140+
local targets = table.wrap(opt.target)
141+
ninja.install(package, targets, {buildir = buildir, envs = opt.envs or buildenvs(package, opt)})
141142
end

0 commit comments

Comments
 (0)