build: copy each treesitter parser library individually #20797

Copying each .so file one by one, rather than the entire parser
directory, allows newer .so files to overwrite older .so files with the
same name. This is useful when bumping a parser version and rebuilding
neovim without needing to run `make distclean` beforehand.
This commit is contained in:
dundargoc
2022-10-27 06:46:18 +02:00
committed by GitHub
parent 0117c97e62
commit 7765f2bb83

View File

@@ -571,7 +571,10 @@ file(MAKE_DIRECTORY ${BINARY_LIB_DIR})
# install treesitter parser if bundled
if(EXISTS ${DEPS_PREFIX}/lib/nvim/parser)
file(COPY ${DEPS_PREFIX}/lib/nvim/parser DESTINATION ${BINARY_LIB_DIR})
glob_wrapper(TREESITTER_PARSERS ${DEPS_PREFIX}/lib/nvim/parser/*)
foreach(parser_lib ${TREESITTER_PARSERS})
file(COPY ${parser_lib} DESTINATION ${BINARY_LIB_DIR}/parser)
endforeach()
endif()
install(DIRECTORY ${BINARY_LIB_DIR}