aboutsummaryrefslogtreecommitdiff
path: root/lua/cmake/actions.lua
diff options
context:
space:
mode:
authorDaniil Rozanov <daniilrozzanov@gmail.com>2024-05-03 01:24:29 +0300
committerDaniil Rozanov <daniilrozzanov@gmail.com>2024-05-03 01:24:29 +0300
commit1caad46f40e1965e4bf0cc68d98f341bc4310d8c (patch)
tree622cab831bb5354cbb7be72ab213617652199818 /lua/cmake/actions.lua
parentbbe3a27633002d9eb37c98603e34a00e9ea9d962 (diff)
docs: lua documentation for most used tables and functions
Diffstat (limited to 'lua/cmake/actions.lua')
-rw-r--r--lua/cmake/actions.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/lua/cmake/actions.lua b/lua/cmake/actions.lua
index 9f16bf5..0eff4ed 100644
--- a/lua/cmake/actions.lua
+++ b/lua/cmake/actions.lua
@@ -54,7 +54,7 @@ end
---@return table
local _extend_generate_command = function(command, opts)
opts = opts or {}
- local new = vim.tbl_deep_extend("keep", command, {})
+ local new = vim.deepcopy(command)
return new
end
@@ -63,13 +63,16 @@ end
---@param opts BuildOpts
---@return table
local _extend_build_command = function(command, opts)
- local new = vim.tbl_deep_extend("keep", command, {})
+ local new = vim.deepcopy(command)
if opts.j then
new.args = new.args .. " -j " .. tostring(opts.j)
end
if opts.clean then
new.args = new.args .. " --clean-first"
end
+ if opts.target and #opts.target ~= 0 then
+ new.args = new.args .. " --target " .. table.concat(opts.target, " ")
+ end
return new
end
@@ -157,7 +160,7 @@ end
---@class BuildOpts
---@field clean boolean|nil
---@field j number|nil
----@field target number|nil
+---@field target string[]|nil
--- Build project with current build option
--- @param opts BuildOpts