feat(tree-sitter): support new --with-tree-sitter configure flag

This commit is contained in:
2022-12-01 22:08:29 +00:00
parent 1ae8771b2c
commit 0ba971ef61
2 changed files with 17 additions and 0 deletions

View File

@@ -25,4 +25,5 @@ brew 'nettle'
brew 'pkg-config'
brew 'sqlite'
brew 'texinfo'
brew 'tree-sitter'
brew 'zlib'

View File

@@ -250,6 +250,12 @@ class Build
@supports_xwidgets ||= !!configure_help.match(/\s+--with-xwidgets\s+/)
end
def supports_tree_sitter?
@supports_tree_sitter ||= !!configure_help.match(
/\s+--with-tree-sitter(\s|=).+/
)
end
def supports_native_comp?
@supports_native_comp ||= !native_comp_configure_flag.nil?
end
@@ -385,6 +391,9 @@ class Build
if options[:xwidgets] && supports_xwidgets?
configure_flags << '--with-xwidgets'
end
if options[:tree_sitter] && supports_tree_sitter?
configure_flags << '--with-tree-sitter'
end
configure_flags << native_comp_configure_flag if options[:native_comp]
configure_flags << '--without-rsvg' if options[:rsvg] == false
configure_flags << '--without-dbus' if options[:dbus] == false
@@ -1243,6 +1252,7 @@ if __FILE__ == $PROGRAM_NAME
rsvg: true,
dbus: true,
xwidgets: true,
tree_sitter: true,
github_auth: true,
dist_include: ['COPYING'],
archive: true,
@@ -1278,6 +1288,12 @@ if __FILE__ == $PROGRAM_NAME
cli_options[:xwidgets] = v
end
opts.on('--[no-]tree-sitter',
'Enable/disable tree-sitter if supported' \
'(default: enabled)') do |v|
cli_options[:tree_sitter] = v
end
opts.on('--[no-]native-comp',
'Enable/disable native-comp ' \
'(default: enabled if supported)') do |v|