Allow compilation via makefile

This commit is contained in:
Stephan Seitz 2021-09-09 22:11:07 +02:00
parent 045cb86d44
commit a37c97545f
4 changed files with 42 additions and 9 deletions

View file

@ -93,6 +93,30 @@ function M.select_compiler_args(repo, compiler)
end
end
function M.select_compile_command(repo, cc, compile_location)
if string.match(cc, "cl$") or string.match(cc, "cl.exe$") or not repo.use_makefile then
return {
cmd = cc,
info = "Compiling...",
err = "Error during compilation",
opts = {
args = vim.tbl_flatten(M.select_compiler_args(repo, cc)),
cwd = compile_location,
},
}
else
return {
cmd = "make",
info = "Compiling...",
err = "Error during compilation",
opts = {
args = { "--makefile=" .. utils.join_path(utils.get_package_path(), "scripts", "compile_parsers.makefile"), "CC=" .. cc },
cwd = compile_location,
},
}
end
end
function M.select_install_rm_cmd(cache_folder, project_name)
if fn.has "win32" == 1 then
local dir = cache_folder .. "\\" .. project_name