summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRedbeanw44602 <[email protected]>2025-07-27 19:22:00 +0800
committerRedbeanw44602 <[email protected]>2025-07-27 19:22:00 +0800
commit3897a0f1b1859d1cea57d71a517e963674df2622 (patch)
treeaa21523e80cda04d72268f56ee22915fe70fae15
parent16fb087ad29883bd2ea4bc082be2cda621b578c1 (diff)
support `opt.targets` in cmake tools.
-rw-r--r--xmake/modules/package/tools/cmake.lua10
-rw-r--r--xmake/modules/package/tools/ninja.lua2
2 files changed, 7 insertions, 5 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 90b2530ee..6be6b5952 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -1075,7 +1075,7 @@ end
-- do build for make
function _build_for_make(package, configs, opt)
local argv = {}
- local targets = table.wrap(opt.target)
+ local targets = opt.targets or table.wrap(opt.target)
if #targets ~= 0 then
table.join2(argv, targets)
end
@@ -1110,7 +1110,8 @@ function _build_for_ninja(package, configs, opt)
_fix_pdbdir_for_ninja(package)
ninja.build(package, {}, {envs = opt.envs or buildenvs(package, opt),
jobs = opt.jobs,
- target = opt.target})
+ target = opt.target,
+ targets = opt.targets})
end
-- do build for cmake/build
@@ -1121,7 +1122,7 @@ function _build_for_cmakebuild(package, configs, opt)
table.insert(argv, "--config")
table.insert(argv, opt.config)
end
- local targets = table.wrap(opt.target)
+ local targets = opt.targets or table.wrap(opt.target)
if #targets ~= 0 then
table.insert(argv, "--target")
if #targets > 1 then
@@ -1199,7 +1200,8 @@ function _install_for_ninja(package, configs, opt)
_fix_pdbdir_for_ninja(package)
ninja.install(package, {}, {envs = opt.envs or buildenvs(package, opt),
jobs = opt.jobs,
- target = opt.target})
+ target = opt.target,
+ targets = opt.targets})
end
-- do install for cmake/build
diff --git a/xmake/modules/package/tools/ninja.lua b/xmake/modules/package/tools/ninja.lua
index 4aab472ec..5905e326c 100644
--- a/xmake/modules/package/tools/ninja.lua
+++ b/xmake/modules/package/tools/ninja.lua
@@ -31,7 +31,7 @@ function _default_argv(package, configs, opt)
end
local argv = {}
- local targets = table.wrap(opt.target)
+ local targets = opt.targets or table.wrap(opt.target)
if #targets ~= 0 then
table.join2(argv, targets)
end