some nice fixes

This commit is contained in:
2025-11-19 13:33:11 -03:00
parent 92b3bd1af3
commit e5a08226b7
2 changed files with 41 additions and 3 deletions

View File

@@ -41,8 +41,23 @@ end
function M.configure_cmake(build_type)
vim.fn.mkdir("build", "p")
local cmake_module_path = vim.fn.getenv("CMAKE_MODULE_PATH")
local module_path_arg = ""
if cmake_module_path ~= nil and cmake_module_path ~= "" then
module_path_arg = "-DCMAKE_MODULE_PATH=" .. cmake_module_path
end
local cmake_args = {
module_path_arg,
"-DCMAKE_BUILD_TYPE=" .. build_type,
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
".."
}
float_term(
{ M.find_cmake(), "-DCMAKE_BUILD_TYPE=" .. build_type, "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", ".." },
{ M.find_cmake(), unpack(cmake_args) },
{ cwd = "build" }
)
end