Search code examples
dconditional-compilation

D: Define custom version identifier for conditional compilation


The D documentation talks about predefined version identifiers, but not how to define your own version. How do I do it?

Since this feature is supposed to be the D counterpart to C/C++'s #if/#ifdef, I doubt they would lock us to only the predifined versions.


Solution

  • You can pass a version to the compiler when building with the -version=whatever switch.