mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-12-25 12:14:19 +01:00
feat(treesitter): on windows, use gcc if available and cl.exe is not available for building parsers
This commit is contained in:
@@ -59,6 +59,16 @@ return {
|
||||
config = function(_, opts)
|
||||
local TS = require("nvim-treesitter")
|
||||
|
||||
-- On Windows, use `gcc` if `cl` is not available, and `gcc` is.
|
||||
if
|
||||
not vim.env.CC
|
||||
and vim.fn.has("win32") == 1
|
||||
and vim.fn.executable("cl") == 0
|
||||
and vim.fn.executable("gcc") == 1
|
||||
then
|
||||
vim.env.CC = "gcc"
|
||||
end
|
||||
|
||||
setmetatable(require("nvim-treesitter.install"), {
|
||||
__newindex = function(_, k)
|
||||
if k == "compilers" then
|
||||
|
||||
Reference in New Issue
Block a user