Compiler options

Run mox help to see every option. This page covers the ones you will use most.

Most options are written as name=value. A few short flags (-O3, -g, -o) work like in other compilers.

Backends

Mox has three backends:

Pick one with backend=:

mox ./hello.mox backend=llvm

Optimizations

mox ./hello.mox -O3

Debug info

-g writes DWARF debug info, so you can use a debugger. It also turns on embed_source_paths=true.

mox ./hello.mox -g

Output paths

Missing folders in these paths are created.

mox ./hello.mox -o=./build/hello

Other useful options

Placeholders

Some options can use placeholders. The compiler replaces them: