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.
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):
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, invokingmake
the second time compiles only 4 cpp source files.