aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2022-12-29 21:47:28 +0100
committerStephan Seitz <stephan.seitz@fau.de>2023-01-08 00:33:13 +0100
commit86345612b76c1c441b11be0b16e76e0c136107c6 (patch)
treea45217d9476d6e36a66a28c4ee4f68b2234c3396 /lua
parentUpdate parsers: c_sharp, clojure, cpp, cuda, fortran, gitcommit, hlsl, http, ... (diff)
downloadnvim-treesitter-86345612b76c1c441b11be0b16e76e0c136107c6.tar
nvim-treesitter-86345612b76c1c441b11be0b16e76e0c136107c6.tar.gz
nvim-treesitter-86345612b76c1c441b11be0b16e76e0c136107c6.tar.bz2
nvim-treesitter-86345612b76c1c441b11be0b16e76e0c136107c6.tar.lz
nvim-treesitter-86345612b76c1c441b11be0b16e76e0c136107c6.tar.xz
nvim-treesitter-86345612b76c1c441b11be0b16e76e0c136107c6.tar.zst
nvim-treesitter-86345612b76c1c441b11be0b16e76e0c136107c6.zip
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 <chronobserver@disroot.org>
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