I'd like to get the compiler name and version from within the D code automatically so my binary can output the following:
Built with COMPILER_NAME COMPILER_VERSION
It is possible?
Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
July 29, 2022 How to get compiler name and version from D code? | ||||
---|---|---|---|---|
| ||||
I'd like to get the compiler name and version from within the D code automatically so my binary can output the following:
It is possible? |
July 29, 2022 Re: How to get compiler name and version from D code? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kirill | Special tokens: https://dlang.org/spec/lex.html#special-token-sequence You can also determine the compiler by a version. |
July 29, 2022 Re: How to get compiler name and version from D code? | ||||
---|---|---|---|---|
| ||||
Posted in reply to rikki cattermole | On Friday, 29 July 2022 at 09:37:09 UTC, rikki cattermole wrote:
> Special tokens: https://dlang.org/spec/lex.html#special-token-sequence
>
> You can also determine the compiler by a version.
Thank you!
|
July 29, 2022 Re: How to get compiler name and version from D code? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kirill | On Friday, 29 July 2022 at 09:29:47 UTC, Kirill wrote: >
Something like this:
With a bit more effort you could format the version nicely as "2.099". |
July 29, 2022 Re: How to get compiler name and version from D code? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dennis | On Friday, 29 July 2022 at 09:57:43 UTC, Dennis wrote: >On Friday, 29 July 2022 at 09:29:47 UTC, Kirill wrote: >
Something like this:
With a bit more effort you could format the version nicely as "2.099". Or just |