Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ee8f2200 authored by Théotime Grohens's avatar Théotime Grohens
Browse files

[aevol] Print compile commit branch, hash and date

This commit adds the ability to get the branch, date and hash of the
commit that was used to compile Aevol from within the C++ source of Aevol.

This is useful because it allows us to print it (for example) at the
beginning of the execution of one of the Aevol programs, making it
easier to see whether we're running the right version.

In order to do this, a special file `aevol_version.cpp.in` is introduced.
This file is modified by CMake a first time at configure time, replacing
a placeholder with the value of the PROJECT_VERSION CMake variable, and
a second time at compile time, replacing a placeholder with a custom
CMake variable that holds the branch, hash and date.

This turns the file into a regular C++ source file, that is then compiled
and linked with the rest of Aevol through the `aevol_version.h` header.

Finally, we print this string in the two most commonly used Aevol
executables, `aevol_create` and `aevol_run`.
parent 59b907ed
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment