Skip to content

Instantly share code, notes, and snippets.

@thendrix
Created February 3, 2020 06:20
Show Gist options
  • Save thendrix/a78679f28c78ba030f6ecc1f7824d666 to your computer and use it in GitHub Desktop.
Save thendrix/a78679f28c78ba030f6ecc1f7824d666 to your computer and use it in GitHub Desktop.
Snippet for git version for build header
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