Get Crystal compiler version from executable

Hi,
Are the Crystal compiler and/or the LLVM versions, such as given by the crystal -v command, stored in some manner in the executable ?
Thanks

See Crystal - Crystal 1.1.1.

OK, thanks.
(But as far as I could check, these constants are not integrated by default in the compiled code).

They represent the versions used to compile the Crystal binary that is being used. What are you wanting to do?

You can do the following to embed the Crystal version in the output program. The information is not embedded by default.

COMPILED_WITH = {{ Crystal::VERSION }}
puts COMPILED_WITH

The same can be used usually to embed version information of other dependencies.

4 Likes