Main crate: darknet
Version 0.2.0 changes:
To ensure the git submodules are tracked, please run git submodule init && git submodule update --recursive
after you clone this repository.
There are two ways to generate the bindings:
By default, it builds the darknet static library from submodule if there is no additional environment variables and features.
If you want to build dynamic library, enable 'dylib' feature.
It is the default behavior. If you would like to build your own source, you can set the DARKNET_SRC
environment variables to the path of your repository. Note that it expects a CMakeLists.txt
in your repository.
sh
export DARKNET_SRC=/path/to/your/darknet/repo # if you would like to build your own source
cargo build
If you prefer not to build the source code and use the generated bindings already built in our repository, add the runtime
feature to take effect.
sh
cargo build --feature runtime
The buildtime-bindgen
allows you to re-generate bindings from headers without compiling the source code. By default, it finds the header files from the shipped darknet submodule. If you would like to provide your own header files, please set DARKNET_INCLUDE_PATH
the environment variable.
sh
export DARKNET_INCLUDE_PATH=/path/to/your/header/dir
cargo build --feature runtime,buildtime-bindgen
Huge thanks to jerry73204