From 86345612b76c1c441b11be0b16e76e0c136107c6 Mon Sep 17 00:00:00 2001 From: Stephan Seitz Date: Thu, 29 Dec 2022 21:47:28 +0100 Subject: install: allow pure C parsers to be compiled without `-lstdc++` E.g. installing C [here](https://github.com/nvim-treesitter/nvim-treesitter/issues/4056) does not require libstdc++. Co-authored-by: ObserverOfTime --- lua/nvim-treesitter/shell_command_selectors.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lua') 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 -- cgit v1.2.3-70-g09d2