emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tree-sitter integration on feature/tree-sitter


From: Eli Zaretskii
Subject: Re: Tree-sitter integration on feature/tree-sitter
Date: Sat, 14 May 2022 22:09:59 +0300

> From: Daniel Martín <mardani29@yahoo.es>
> Cc: Emacs Devel <emacs-devel@gnu.org>
> Date: Sat, 14 May 2022 20:50:39 +0200
> 
> The problem I tried to solve was this linker error:
> 
>   ld: library not found for -ltree-sitter
> 
> The reason is that the custom library directory on my system,
> /opt/homebrew/Cellar/, needs to be set via -L, but setting
> TREE_SITTER_LIBS overrided that.  Pkg-config already provides the
> necessary linker flags to use the library.
> 
> With my change, I get the following in config.log:
> 
> TREE_SITTER_LIBS='-L/opt/homebrew/Cellar/tree-sitter/0.20.6/lib -ltree-sitter'
> 
> which is similar, for example, to how Jansson is linked:
> 
> JSON_LIBS='-L/opt/homebrew/Cellar/jansson/2.14/lib -ljansson'
> 
> and all compiles and links successfully.

The compiler and linker switches for linking against the library are
supposed to come from pkg-config (which gets them from tree-sitter.pc
file that is part of the tree-sitter library's installation).

> N.B: I don't know if this would work on MS-Windows.  Perhaps MS-Windows
> loads tree-sitter dynamically and will need a special case that just
> unsets TREE_SITTER_LIBS.

Don't worry about Windows, we will figure this out when there's a
first Emacs user who wants to build that branch on Windows.  And
initially, there's nothing wrong with linking against the library
statically even on Windows: the resulting binary will work.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]