aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorCarlo Cabrera <30379873+carlocab@users.noreply.github.com>2023-04-03 12:46:21 +0800
committerAmaan Qureshi <amaanq12@gmail.com>2023-04-03 03:38:54 -0400
commit6f5a4f6306e6dfd23f93c8b60493871c9a600cc0 (patch)
tree05ce5a0fde8e65caf9eb119631b99ef2315ca12a /lua
parentUpdate parsers: awk, tiger (diff)
downloadnvim-treesitter-6f5a4f6306e6dfd23f93c8b60493871c9a600cc0.tar
nvim-treesitter-6f5a4f6306e6dfd23f93c8b60493871c9a600cc0.tar.gz
nvim-treesitter-6f5a4f6306e6dfd23f93c8b60493871c9a600cc0.tar.bz2
nvim-treesitter-6f5a4f6306e6dfd23f93c8b60493871c9a600cc0.tar.lz
nvim-treesitter-6f5a4f6306e6dfd23f93c8b60493871c9a600cc0.tar.xz
nvim-treesitter-6f5a4f6306e6dfd23f93c8b60493871c9a600cc0.tar.zst
nvim-treesitter-6f5a4f6306e6dfd23f93c8b60493871c9a600cc0.zip
feat: use `-bundle` to build parsers on macOS
This will make the parsers align more closely to the ones bundled with Neovim, because CMake uses the `-bundle` flag (instead of `-shared`) on macOS when a library is compiled as a `MODULE`. See, for example: https://github.com/neovim/neovim/blob/10baf89712724b4b95f7c641f2012f051737003c/cmake.deps/cmake/TreesitterParserCMakeLists.txt#L6-L9
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/shell_command_selectors.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lua/nvim-treesitter/shell_command_selectors.lua b/lua/nvim-treesitter/shell_command_selectors.lua
index cf99a01d7..de44ffa1c 100644
--- a/lua/nvim-treesitter/shell_command_selectors.lua
+++ b/lua/nvim-treesitter/shell_command_selectors.lua
@@ -110,9 +110,13 @@ function M.select_compiler_args(repo, compiler)
"parser.so",
"-I./src",
repo.files,
- "-shared",
"-Os",
}
+ if fn.has "mac" == 1 then
+ table.insert(args, "-bundle")
+ else
+ table.insert(args, "-shared")
+ end
if
#vim.tbl_filter(function(file) ---@param file string
local ext = vim.fn.fnamemodify(file, ":e")