Skip to content

Commit ae526f1

Browse files
committed
fix: CMakeBuild always builds all targets #321
1 parent 85f7e68 commit ae526f1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lua/cmake-tools/init.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,10 @@ function cmake.build(opt, callback)
367367
if config.build_preset then
368368
local build_preset = presets:get_build_preset(config.build_preset)
369369
if build_preset then
370-
config.build_target = build_preset:get_build_target()
370+
local build_target_from_build_preset = build_preset:get_build_target()
371+
if build_target_from_build_preset ~= "" then
372+
config.build_target = build_target_from_build_preset
373+
end
371374
end
372375
end
373376
end
@@ -398,7 +401,7 @@ function cmake.build(opt, callback)
398401
vim.list_extend(args, { "--target", opt.target })
399402
vim.list_extend(args, fargs)
400403
elseif config.build_target ~= nil then
401-
vim.list_extend(args, { "--target", "all" })
404+
vim.list_extend(args, { "--target", config.build_target })
402405
vim.list_extend(args, fargs)
403406
end
404407

0 commit comments

Comments
 (0)