Build Instructions¶
Dependencies¶
Cargo Features¶
These features can be enabled or disabled using cargo’s --features flag.
| Feature | Description |
|---|---|
capture (default) |
Enables the capture sub-command. |
license (default) |
Enables the license sub-command. |
rustls-tls (default) |
Enables the rustls TLS backend for the reqwest crate. |
native-tls |
Enables the native-tls TLS backend for the reqwest crate. |
native-tls-vendored |
Enables the native-tls-vendored TLS backend for the reqwest crate. |
Native Compilation¶
git clone https://github.com/clitic/vsd --depth 1
cd vsd
cargo build -p vsd --release
# optional - generate cli docs (docs/cli.md)
cargo run -p vsd --example vsd-docs --all-features
Cross Compilation¶
Android¶
-
Install Android NDK on your system. You can also use cargo-ndk to build vsd.
-
Add desired build targets using rustup.
-
Now build with desired target.
RUSTFLAGS="-C linker=aarch64-linux-android25-clang -C link-args=-Wl,-rpath=/data/data/com.termux/files/usr/lib" \ PATH="$HOME/android-ndk-r27d/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH" \ AR="llvm-ar" \ CC="aarch64-linux-android25-clang" \ CXX="aarch64-linux-android25-clang++" \ cargo build -p vsd --release --target aarch64-linux-android --no-default-features --features "license,native-tls-vendored" # optional - inspect binary llvm-readobj target/aarch64-linux-android/release/vsd --needed-libsNote
If you are not building for termux, then you can remove
rpathlink arg.
Termux¶
You can also compile vsd directly on android using Termux.
pkg update
pkg upgrade
pkg install cmake git protobuf rust
git clone https://github.com/clitic/vsd --depth 1
cd vsd
AR=llvm-ar \
OPENSSL_INCLUDE_DIR=$PREFIX/include/openssl \
OPENSSL_LIB_DIR=$PREFIX/lib \
cargo build -p vsd --release --no-default-features --features "license,native-tls"
Darwin¶
-
Download desired MacOSX SDK.
-
Add desired build targets using rustup.
-
Now build with desired target.
RUSTFLAGS="-C linker=clang -C link-arg=--target=aarch64-apple-darwin -C link-arg=-isysroot -C link-arg=$HOME/MacOSX26.1.sdk -C link-arg=-fuse-ld=lld" \ AR="llvm-ar" \ CC="clang --target=aarch64-apple-darwin -isysroot $HOME/MacOSX26.1.sdk -fuse-ld=lld" \ CXX="clang++ --target=aarch64-apple-darwin -isysroot $HOME/MacOSX26.1.sdk -fuse-ld=lld" \ cargo build -p vsd --release --target aarch64-apple-darwin # optional - inspect binary llvm-readobj target/aarch64-apple-darwin/release/vsd --macho-version-min --needed-libs
Linux (MUSL)¶
-
Install Zig and cargo-zigbuild on ypur system.
-
Add desired build targets using rustup.
-
Now build with desired target using cargo-zigbuild.
Windows (MSVC)¶
-
Install cargo-xwin on your system.
-
Add desired build targets using rustup.
-
Now build with desired target using cargo-xwin.