generate_bindings.jl (525B)
1 #!/usr/bin/env julia 2 # Developer tool: regenerate src/libnickel.jl from deps/nickel_lang.h 3 # Usage: julia --project=deps/ deps/generate_bindings.jl 4 5 using Clang 6 using Clang.Generators 7 8 cd(@__DIR__) 9 10 header = joinpath(@__DIR__, "nickel_lang.h") 11 if !isfile(header) 12 error("deps/nickel_lang.h not found. Build the Nickel C API first.") 13 end 14 15 options = load_options(joinpath(@__DIR__, "generator.toml")) 16 ctx = create_context([header], get_default_args(), options) 17 build!(ctx) 18 19 println("Bindings generated at src/libnickel.jl")