chore: update packages

This commit is contained in:
2026-03-11 14:53:19 +02:00
parent 347e99f256
commit 356820577e
43 changed files with 207 additions and 8649 deletions

32
CMakeLists.txt generated
View File

@@ -2,19 +2,21 @@ cmake_minimum_required(VERSION 3.13)
project(tree-sitter-bruno
VERSION "0.1.0"
DESCRIPTION " Bruno grammar for tree-sitter"
HOMEPAGE_URL "https://github.com/kristoferssolo/tree-sitter-bruno"
DESCRIPTION "Bruno grammar for tree-sitter"
HOMEPAGE_URL "https://codeberg.org/kristoferssolo/tree-sitter-bruno"
LANGUAGES C)
option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
option(TREE_SITTER_REUSE_ALLOCATOR "Reuse the library allocator" OFF)
set(TREE_SITTER_ABI_VERSION 14 CACHE STRING "Tree-sitter ABI version")
set(TREE_SITTER_ABI_VERSION 15 CACHE STRING "Tree-sitter ABI version")
if(NOT ${TREE_SITTER_ABI_VERSION} MATCHES "^[0-9]+$")
unset(TREE_SITTER_ABI_VERSION CACHE)
message(FATAL_ERROR "TREE_SITTER_ABI_VERSION must be an integer")
endif()
include(GNUInstallDirs)
find_program(TREE_SITTER_CLI tree-sitter DOC "Tree-sitter CLI")
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c"
@@ -25,10 +27,13 @@ add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c"
COMMENT "Generating parser.c")
add_library(tree-sitter-bruno src/parser.c)
if(EXISTS src/scanner.c)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scanner.c)
target_sources(tree-sitter-bruno PRIVATE src/scanner.c)
endif()
target_include_directories(tree-sitter-bruno PRIVATE src)
target_include_directories(tree-sitter-bruno
PRIVATE src
INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/bindings/c>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_compile_definitions(tree-sitter-bruno PRIVATE
$<$<BOOL:${TREE_SITTER_REUSE_ALLOCATOR}>:TREE_SITTER_REUSE_ALLOCATOR>
@@ -44,17 +49,18 @@ set_target_properties(tree-sitter-bruno
configure_file(bindings/c/tree-sitter-bruno.pc.in
"${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-bruno.pc" @ONLY)
include(GNUInstallDirs)
install(FILES bindings/c/tree-sitter-bruno.h
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/tree_sitter")
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bindings/c/tree_sitter"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
FILES_MATCHING PATTERN "*.h")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-bruno.pc"
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig")
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
install(TARGETS tree-sitter-bruno
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
add_custom_target(test "${TREE_SITTER_CLI}" test
file(GLOB QUERIES queries/*.scm)
install(FILES ${QUERIES}
DESTINATION "${CMAKE_INSTALL_DATADIR}/tree-sitter/queries/bruno")
add_custom_target(ts-test "${TREE_SITTER_CLI}" test
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "tree-sitter test")
# vim:ft=cmake: