Skip to content

Commit

Permalink
feat(tree-sitter): support new --with-tree-sitter configure flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jimeh committed Dec 1, 2022
1 parent 1ae8771 commit 0ba971e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ brew 'nettle'
brew 'pkg-config'
brew 'sqlite'
brew 'texinfo'
brew 'tree-sitter'
brew 'zlib'
16 changes: 16 additions & 0 deletions build-emacs-for-macos
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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|
Expand Down

0 comments on commit 0ba971e

Please sign in to comment.