- Best Answerset by MikeCL
Solved with the help of jagh201 on the discord:
# SCsub
import os
Import('env')
env.add_source_files(env.modules_sources, "/home/teehee/git/tree-sitter/lib/src/lib.c")
env.Append(CPPPATH=["/home/teehee/git/tree-sitter/lib/include"
, "/home/teehee/git/tree-sitter/lib/src"])
env.StaticLibrary("/home/teehee/godot/modules/simple/ll/tree-sitter", "/home/teehee/git/tree-sitter/lib/src/lib.c")
env.Append(LIBPATH="/home/teehee/godot/modules/simple/ll")
env.Append(LIBS="tree-sitter")
menv = env.Clone()
menv.add_source_files(env.modules_sources, "*.cpp")
I had to let scons build the library itself. The call to StaticLibrary produced an object called libtree-sitter.windows.x86-64.a I renamed it libtree-sitter.a, commented out StaticLibrary, and it worked from there.