svenreiche / Genesis-1.3-Version4

Time-dependent, 3D Code to simulate the amplification process of a Free-electron Laser.
GNU General Public License v3.0
53 stars 26 forks source link

reorganize #include "version.h" #161

Closed ZeugAusHH closed 4 months ago

ZeugAusHH commented 4 months ago

To include the git commit id of the source code into the compiled binary, the build process uses the header file "version.h", that is generated every time make is ran. So far this header file was in turn included by other header files, resulting in many dependencies from a file changing during every time a build is done.

This patch removes the includes from other header files and "version.h" is instead included directly where it is needed.

Test case (run it in your build directory):

cmake -DCMAKE_BUILD_TYPE=Debug ..
make
make

With the source files in commit id 4681421b (date: 2024-03-20), invoking make a second time (without changing any source file) results in the compilation of 41 cpp source files (takes a bit above a minute in my development environment). With the changes in this patch, invoking make the second time compiles only 4 cpp source files.