Jump to content

An Introduction to Dragon/Lessons/Installation

From Wikibooks, open books for an open world

Installation and Building from Source

[edit | edit source]

Dragon is currently distributed as source and built with Cargo, so a recent stable Rust toolchain (edition 2021) is required.

Cloning and building

[edit | edit source]
# Clone the repository
git clone https://github.com/aaveshdev/dragon.git
cd dragon

# Build the CLI in debug mode
cargo build

# Build an optimized release binary (recommended)
cargo build --release

The compiled CLI binary is produced as dragon (or dragon.exe on Windows) at:

target/release/dragon

Cargo also builds a shared library (dragon_lib, i.e. dragon_lib.dll / libdragon_lib.so / libdragon_lib.dylib) automatically alongside the CLI, since the library target's crate type includes both cdylib and rlib.

Installing the CLI globally

[edit | edit source]
cargo install --path .

This installs the dragon binary onto your PATH, so it can be invoked from any directory.

Feature and target notes

[edit | edit source]
  • Native codegen (--native) shells out to a system C compiler (gcc, clang, or cl on Windows), so one of these must be on your PATH for that feature to work.
  • Android targets pull in jni / ndk dependencies automatically.
  • WASM targets pull in wasm-bindgen / web-sys / getrandom automatically.
  • On aarch64-unknown-linux-gnu, OpenSSL is vendored and built from source, so a C toolchain is required there as well.

License

[edit | edit source]

Dragon is licensed under the MIT License.