Enable subproject tree-sitter-c in librz/type (#4550)

This commit is contained in:
Heersin 2024-06-14 08:26:37 +08:00 committed by GitHub
parent fb384a4957
commit 3dcca03ced
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View file

@ -18,7 +18,9 @@ if r.returncode() == 1 and get_option('subprojects_check')
error('Subprojects are not updated. Please run `git clean -dxff subprojects/` to delete all local subprojects directories. If you want to compile against current subprojects then set option `subprojects_check=false`.')
endif
tree_sitter_c_dep = dependency('tree-sitter-c')
# use subproject/tree-sitter-c
# tree_sitter_c_dep = dependency('tree-sitter-c')
rz_type_inc = [
platform_inc,

View file

@ -300,6 +300,19 @@ if not tree_sitter_dep.found()
meson.override_dependency('tree-sitter', tree_sitter_dep)
endif
# handle tree-sitter-c
r = run_command(py3_exe, check_meson_subproject_py, 'tree-sitter-c', check: false)
if r.returncode() == 1 and get_option('subprojects_check')
error(subproject_clean_error_msg)
endif
tree_sitter_c_dep = dependency('tree-sitter-c', required: get_option('use_sys_tree_sitter'), static: is_static_build, fallback: [])
if not tree_sitter_c_dep.found()
tree_sitter_c_proj = subproject('tree-sitter-c', default_options: ['default_library=static'])
tree_sitter_c_dep = tree_sitter_c_proj.get_variable('tree_sitter_c_dep')
# override done in tree sitter c subproject
endif
has_debugger = get_option('debugger')
have_ptrace = not ['windows', 'cygwin', 'sunos', 'haiku'].contains(host_machine.system())
use_ptrace_wrap = ['linux'].contains(host_machine.system())