Skip to content

Build

As another useful subcommand, it helps us to build the final binary and generate .d.ts. Standard command will be:

shell
ohrs build

It supports some special options.

Optionsdescriptiontypedefault
releasebuild mode,if it be set with true, project will build with release modebooleanfalse
distThe final binary's folderstringdist
stripUse llvm-strip to reduce the size of the binary files. Set the mode to true if it's in release modebooleantrue

Usage

Here are some examples to use them.

--release

shell
ohrs build --release

If we use --release, project will build with release mode.

--compact

shell
ohrs build --compact

If we use --compact, the final folder will be:

Dist

All the final binary will in a same folder.

--dist new_folder

shell
cargo build --dist new_folder

Now, the final project structure will be:

Dist

--strip

shell
# enabled
cargo build --strip

# disabled
cargo build --strip=false