allow compilation without git or when git fails#300
allow compilation without git or when git fails#300ursfassler wants to merge 1 commit intocucumber:mainfrom
Conversation
This happens when the code is downloaded as source archive. This does not contain the git repository, hence the git version script fails. Now the version 0.0.0+YEAR.MONTH.DAY is used when we fail to get the version from git.
|
@kreuzberger please let me know if this works for the compilation problem mentioned in #295. |
|
Technically this solves my problem using the downloaded zip/tar archive for the tag. But is this the real intention of your software deployment? As long as i am using Tags of your library/executable, i would expect to see the correct version number of the software/library. So maybe the software version should be hardcoded and not be 0.0.0 between the tags. It would be okay to add the timestamp/date information (0.7.0+ddmmyy) so that is clear this is not an "offical" git tag build. (that this project does not provide). Another way could be a "released" version of your code, where the version comes from a file generated during the release build. The source code then must be provided as release in github. Easiest way would be to hard code the version in this file and then
I think this would fix it and you only have a single source of truth for your version. (obviously this is not true, cause you still have manually coded versions e.g. in changelogs or other non-source-code files). Up to you 👍 |
Summary
Allow compilation without git or when git fails.
Details
This happens when the code is downloaded as source archive. This does not contain the git repository, hence the git version script fails.
Now the version 0.0.0+YEAR.MONTH.DAY is used when we fail to get the version from git.
Motivation and Context
One problem mentioned in #295.
How Has This Been Tested?
Manually by removing the .git directory and adding it back again.
Downloaded the zip archive and did a CMake configure.
Types of changes
Checklist: