aboutsummaryrefslogtreecommitdiff
path: root/cmake.deps/cmake/BuildTreesitter.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake.deps/cmake/BuildTreesitter.cmake')
-rw-r--r--cmake.deps/cmake/BuildTreesitter.cmake14
1 files changed, 10 insertions, 4 deletions
diff --git a/cmake.deps/cmake/BuildTreesitter.cmake b/cmake.deps/cmake/BuildTreesitter.cmake
index 7eb98163b9..f5962c8037 100644
--- a/cmake.deps/cmake/BuildTreesitter.cmake
+++ b/cmake.deps/cmake/BuildTreesitter.cmake
@@ -1,8 +1,14 @@
+if(ENABLE_WASMTIME)
+ set(TREESITTER_ARGS -D TREE_SITTER_FEATURE_WASM=ON)
+endif()
+
get_externalproject_options(treesitter ${DEPS_IGNORE_SHA})
ExternalProject_Add(treesitter
DOWNLOAD_DIR ${DEPS_DOWNLOAD_DIR}/treesitter
- PATCH_COMMAND ${CMAKE_COMMAND} -E copy
- ${CMAKE_CURRENT_SOURCE_DIR}/cmake/TreesitterCMakeLists.txt
- ${DEPS_BUILD_DIR}/src/treesitter/CMakeLists.txt
- CMAKE_ARGS ${DEPS_CMAKE_ARGS}
+ SOURCE_SUBDIR lib
+ CMAKE_ARGS ${DEPS_CMAKE_ARGS} ${TREESITTER_ARGS}
${EXTERNALPROJECT_OPTIONS})
+
+if(USE_BUNDLED_WASMTIME)
+ add_dependencies(treesitter wasmtime)
+endif()