Surprisingly, I discovered that the several mechanisms Odin provides for handling conditional compilation aren't mentioned anywhere in overview. Not even the file suffixes!
Given that quite a few people have asked about this before, and that there is basically no mention of it at all, I've gone ahead and made a section about it.
This section fleshes out how when statements can be used for this, as well as the file suffixes, -defines, and build tags.
It also mentions the otherwise-undocumented build tags using language that makes it clear that users should generally prefer the file suffixes if that covers their use-cases, as the build tags are something of a specialised thing that we don't want being abused.
Surprisingly, I discovered that the several mechanisms Odin provides for handling conditional compilation aren't mentioned anywhere in overview. Not even the file suffixes!
Given that quite a few people have asked about this before, and that there is basically no mention of it at all, I've gone ahead and made a section about it.
This section fleshes out how
when
statements can be used for this, as well as the file suffixes,-define
s, and build tags.It also mentions the otherwise-undocumented build tags using language that makes it clear that users should generally prefer the file suffixes if that covers their use-cases, as the build tags are something of a specialised thing that we don't want being abused.