mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-21 20:11:06 +00:00
feat(treesitter): on windows, use gcc if available and cl.exe is not available for building parsers
This commit is contained in:
parent
f8e8ea4b5e
commit
2a1f3c3701
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue