Created
February 3, 2020 06:20
-
-
Save thendrix/a78679f28c78ba030f6ecc1f7824d666 to your computer and use it in GitHub Desktop.
Snippet for git version for build header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function KaBuild.VersionHeader(self) | |
return KaBuild.SourcePath(self, 'KaVersionBuildId.h') | |
end | |
-- ... | |
prebuildcommands { | |
'echo "#pragma once" > ' .. build:VersionHeader(), | |
'echo -n "#define ENGINE_BUILD_SRC 0x" >> ' .. build:VersionHeader(), | |
'git describe --always >> ' .. build:VersionHeader(), | |
} | |
-- Output looks-a-like dis: | |
-- #pragma once | |
-- #define ENGINE_BUILD_SRC 0x3163c1f29 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment