Rust FFI wrapper to libpigpio.
cargo build
Some parameters are used in build.rs.
LIBCLANG_INCLUDE_PATH
: Path to the target system header directoryLIBPIGPIO_LIB_PATH
: Path to the pigpio libraryLIBPIGPIO_INCLUDE_PATH
: Path to the pigpio header file
For cross compiling, some more configurations are required.
If docker is used, call following command:
docker-compose run --rm cross-builder
or building manually:
pigpio-sys$ cat <<EOF > .cargo/config
[target.arm-unknown-linux-gnueabihf]
linker = "arm-rpi-linux-gnueabihf-gcc"
rustflags = ["-C", "link-args=-Wl,-rpath-link,/usr/lib/arm-linux-gnueabihf"]
EOF
pigpio-sys$ export LIBCLANG_INCLUDE_PATH=/usr/include/clang/7/include
pigpio-sys$ export LIBPIGPIO_LIB_PATH=/path/to/lib
pigpio-sys$ export LIBPIGPIO_INCLUDE_PATH=/path/to/include
pigpio-sys$ cargo build --examples --target=arm-unknown-linux-gnueabihf
- libpigpio1
- libpigpio-dev
- libclang-7-dev