Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Add more `ODIN_*` global constants.

Open Kelimion opened this issue 2 years ago • 0 comments

When benchmarking the influence of compiler versions on a piece of code, it would be nice to print the compiler version (and options) it was compiled with.

Presently this is limited to:

fmt.printf("Compiled with Odin %v.\n\t- Asserts disabled: %v\n\n", ODIN_VERSION, ODIN_DISABLE_ASSERT)
Compiled with Odin dev-2022-12.
    - Asserts disabled: false

To be added:

  • ODIN_VERSION_HASH (either git hash or -dev if unknown)
  • ODIN_OPTIMIZATION_MODE (speed, size, minimal, from -o:)
  • ODIN_DISABLE_BOUNDS_CHECK (false by default, true with -no-bounds-check)
  • ODIN_MICROARCH_STRING (e.g. native, from -microarch:)

Kelimion avatar Dec 09 '22 21:12 Kelimion