Closed kiates closed 5 years ago
Without this, you are forced to edit the generated version file and add -1 or something to the #define in the file.
What we should probably do is make it so we don't even need to define this ourselves - let's add error checking to the HG path so that failure to get an hg revision falls back to "???" instead of producing an empty define.
Hey @rcgordon, how does this look? I can make a Mercurial version of this patch if this looks good to you.
This is now in fna-staging
, which is where I'm keeping things until Ryan merges stuff into Hg (which can take some time...).
The readme says that if you don't have cmake you can pass MOJOSHADER_NO_VERSION_INCLUDE, however there is a case where you may be working with a non-hg cloned repository (but still have hg installed and using cmake). If hg is not detected it uses -1, and so it seems reasonable that if you want to bypass the version generation, it should use the same -1 value if you explicitly pass -DMOJOSHADER_NO_VERSION_INCLUDE.