-
-
Notifications
You must be signed in to change notification settings - Fork 656
Compiler Flags
Tetralux edited this page Nov 8, 2019
·
31 revisions
Running the odin
executable without any arguments (or faulty input) will print the following help description:
odin is a tool for managing Odin source code
Usage:
odin command [arguments]
Commands:
build compile .odin file as executable
run compile and run .odin file
docs generate documentation for a .odin file
version print version
As of right now, docs
is disabled and reserved for generating docs in the future.
In addition, there are several hidden compiler flags. Most flags are on the form -foo=bar
.
-
-out=OUTPUT_FILE_NAME
: Explicitly specify the output file path. -
-resource
: Specify a resource (.rc) file (Windows) -
-opt=LEVEL
: Specify the optimization level. Valid numbers are 0 through 3. -
-show-timings
: Print detailed timings after the compilation stage. -
-thread-count=COUNT
: Specify number of threads available. -
-keep-temp-files
: Do not delete temporary files after compilation. Namely.ll
,.bc
and object files. -
-collection=COLLECTION_NAME=PATH_TO_COLLECTION
: Specifies collection directories. Can be specified multiple times. -
-build-mode=MODE
: Specifies build mode. Can bedll
orexe
.dll
will produce a shared object file in linux. -
-debug
: Compile in debug mode. Windows only at the moment most likely. Produces a.pdb
file, or equivalent. -
-target=TARGET
: For cross-compilation, where TARGET is of the formplatform_arch
. Currently only working for nakst's essence -
-cross-lib-dir
: -
-no-bounds-check
: make#no_bounds_check
global. -
-vet
: Log warnings for unused entities and variable shadowing -
-lld
: Usebin/lld-link.exe
to link instead ofmsvc-link.exe
(Requires the Windows SDK for system libs in the LIB env variable.) -
-no-crt
: Do not link to the CRT. (Warning: Static linked libraries that rely on the CRT will become unusable)