diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-09-17 11:25:22 +0200 |
---|---|---|
committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-11-03 10:39:35 +0100 |
commit | 3eb241d8310f453ce5e5485f12796a0ae43a0a18 (patch) | |
tree | fa214d8724a4c3d3646b1c1c5e12137757464d6f /third-party | |
parent | a061d53e18168130aad537a9e8012390834ff8c2 (diff) | |
download | rneovim-3eb241d8310f453ce5e5485f12796a0ae43a0a18.tar.gz rneovim-3eb241d8310f453ce5e5485f12796a0ae43a0a18.tar.bz2 rneovim-3eb241d8310f453ce5e5485f12796a0ae43a0a18.zip |
bundle: move tree-sitter as a bundled dep
fixup! bundle: move tree-sitter as a bundled dep
fixup! bundle: move tree-sitter as a bundled dep
Diffstat (limited to 'third-party')
-rw-r--r-- | third-party/CMakeLists.txt | 8 | ||||
-rw-r--r-- | third-party/cmake/BuildTreesitter.cmake | 22 |
2 files changed, 30 insertions, 0 deletions
diff --git a/third-party/CMakeLists.txt b/third-party/CMakeLists.txt index 493d7aacdd..27fa05660a 100644 --- a/third-party/CMakeLists.txt +++ b/third-party/CMakeLists.txt @@ -42,6 +42,7 @@ option(USE_BUNDLED_LUV "Use the bundled version of luv." ${USE_BUNDLED}) # build it unless explicitly requested option(USE_BUNDLED_LUA "Use the bundled version of lua." OFF) option(USE_BUNDLED_TS_PARSERS "Use the bundled treesitter parsers." ${USE_BUNDLED}) +option(USE_BUNDLED_TS "Use the bundled treesitter runtime." ${USE_BUNDLED}) if(USE_BUNDLED AND MSVC) option(USE_BUNDLED_GETTEXT "Use the bundled version of gettext." ON) @@ -198,6 +199,9 @@ set(LIBICONV_SHA256 ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc891 set(TREESITTER_C_URL https://github.com/tree-sitter/tree-sitter-c/archive/6002fcd.tar.gz) set(TREESITTER_C_SHA256 46f8d44fa886d9ddb92571bb6fa8b175992c8758eca749cb1217464e512b6e97) +set(TREESITTER_URL https://github.com/tree-sitter/tree-sitter/archive/0.16.9.zip) +set(TREESITTER_SHA256 63ef1f0cfde0f37f4f15803e9412863a397c5276dbc680e8fc917c9f6851ea9b) + if(USE_BUNDLED_UNIBILIUM) include(BuildUnibilium) endif() @@ -253,6 +257,10 @@ if(USE_BUNDLED_TS_PARSERS) include(BuildTreesitterParsers) endif() +if(USE_BUNDLED_TS) + include(BuildTreesitter) +endif() + if(WIN32) include(GetBinaryDeps) diff --git a/third-party/cmake/BuildTreesitter.cmake b/third-party/cmake/BuildTreesitter.cmake new file mode 100644 index 0000000000..3212d6ea08 --- /dev/null +++ b/third-party/cmake/BuildTreesitter.cmake @@ -0,0 +1,22 @@ +set(TS_CFLAGS "-O3 -Wall -Wextra") + +ExternalProject_Add(tree-sitter + PREFIX ${DEPS_BUILD_DIR} + URL ${TREESITTER_URL} + DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/tree-sitter + INSTALL_DIR ${DEPS_INSTALL_DIR} + DOWNLOAD_COMMAND ${CMAKE_COMMAND} + -DPREFIX=${DEPS_BUILD_DIR} + -DDOWNLOAD_DIR=${DEPS_DOWNLOAD_DIR}/tree-sitter + -DURL=${TREESITTER_URL} + -DEXPECTED_SHA256=${TREESITTER_SHA256} + -DTARGET=tree-sitter + -DUSE_EXISTING_SRC_DIR=${USE_EXISTING_SRC_DIR} + -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/DownloadAndExtractFile.cmake + BUILD_IN_SOURCE 1 + PATCH_COMMAND "" + CONFIGURE_COMMAND "" + BUILD_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER} CFLAGS=${TS_CFLAGS} + INSTALL_COMMAND ${MAKE_PRG} CC=${DEPS_C_COMPILER} PREFIX=${DEPS_INSTALL_DIR} install) + +list(APPEND THIRD_PARTY_DEPS tree-sitter) |