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:

    10baf89712/cmake.deps/cmake/TreesitterParserCMakeLists.txt (L6-L9)
This commit is contained in:
Carlo Cabrera 2023-04-03 12:46:21 +08:00 committed by Amaan Qureshi
parent cbfa7cae1b
commit 6f5a4f6306

View file

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