aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/shell_command_selectors.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua
index fd53bbee8..17196b81e 100644
--- a/lua/nvim-treesitter/shell_command_selectors.lua
+++ b/lua/nvim-treesitter/shell_command_selectors.lua
@@ -96,8 +96,14 @@ function M.select_compiler_args(repo, compiler)
repo.files,
"-shared",
"-Os",
- "-lstdc++",
}
+ if
+ #vim.tbl_filter(function(file)
+ return file:match "%.cc$" or file:match "%cpp$" or file:match "%.cxx$"
+ end, repo.files) > 0
+ then
+ table.insert(args, "-lstdc++")
+ end
if fn.has "win32" == 0 then
table.insert(args, "-fPIC")
end