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>
This commit is contained in:
Stephan Seitz 2022-12-29 21:47:28 +01:00
parent 5b8a152c6c
commit 86345612b7

View file

@ -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