From 15a095c151364baa4cddc553f121e8df087983a6 Mon Sep 17 00:00:00 2001 From: Rachel Powers <508861+Ryex@users.noreply.github.com> Date: Sun, 10 Nov 2024 08:48:17 -0700 Subject: [PATCH] append `build_options` last so backend args pass correctly (#263) append the `build_options` args last so that passing `"--", ""` works correctly --- lua/cmake-tools/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/cmake-tools/init.lua b/lua/cmake-tools/init.lua index 899aee1..531648a 100644 --- a/lua/cmake-tools/init.lua +++ b/lua/cmake-tools/init.lua @@ -353,8 +353,6 @@ function cmake.build(opt, callback) } end - vim.list_extend(args, config:build_options()) - if opt.target ~= nil then vim.list_extend(args, { "--target", opt.target }) vim.list_extend(args, fargs) @@ -366,6 +364,8 @@ function cmake.build(opt, callback) vim.list_extend(args, fargs) end + vim.list_extend(args, config:build_options()) + local env = environment.get_build_environment(config) local cmd = const.cmake_command return utils.execute(cmd, config.env_script, env, args, config.cwd, config.executor, callback)