SN bindgen

Scala 3 Native binding generator to C libraries
HomeMotivationConfiguration LimitationsSemantics Quick start

SBT plugin

bindgenVersion: String

Use this to choose another version of bindgen (by default it matches the plugin version)


Use this to override the path to bindgen binary. By default it's resolved from Sonatype for your particular platform.

bindgenBinary := baseDirectory.value / "my-custom-binary"


Usage: bindgen --package <string> --header <string> [--link-name <string>] [--scala] [--c] [--c-import <string>]... [--clang-include <string>]... [--clang <string>]... [--quiet] [--trace | --info | --warning | --error] [--out <string>] [--llvm-bin <string> | --clang-path <string> | --no-system]

Generate Scala 3 native bindings from C header files
Version: 0.0.14+8-94a9e9fb-SNAPSHOT
Built using Scala 3.2.1 and Scala Native 0.4.9

Options and flags:
        Display this help text.
    --package <string>
        Package name (Scala) for generated code
    --header <string>
        C header file with definitions you want bindings for
    --link-name <string>
        Library name for linkage (i.e. 'clang' is equivalent to -lclang flag)
    --indentation-size <integer>
        number of spaces used for indentation (default: 2)
    --base-indentation <integer>
        Base indentation of generated Scala code (default: 0)
        Generate Scala part of the binding
        Generate C part of the binding
    --c-import <string>
        List of C imports to add to generated C file (at the very least you will need the header file for the library itself)
    --clang-include <string>
        List of include paths passed to Clang
    --clang <string>
        List of flags to pass directly to Clang
        Don't output the binding to STDOUT (if you are debugging, for example)
        Output 'trace' log messages or above
        Output 'info' log messages or above
        Output 'warning' log messages or above (this is the default)
        Output 'error' log messages or above
    --exclusive-prefix <string>
        When provided, only definitions that start with this prefix will berendered
    --out <string>
        Path to file where code will be generated. If not provided, result is sent to STDOUT
    --llvm-bin <string>
        Path to the LLVM installation bin/ folder
        If provided, the clang binary from that folder will be used to
        figure out system headers folders
    --clang-path <string>
        Path to the Clang executable
        If provided, the binary will be used 
        figure out system headers folders
        Do NOT attempt to find clang binary and use it to figure out system headers
        Note that this puts the responsibility of providing paths to common system headers on you
        You can use --clang-include option for that