Version reporting: Restart active use of revision.h, now based on a git tag.

The new make-revision script regenerates glslang/Include/revision.h,
used as it always has been, but made with a git-tag version and the
the number of commits on master.

I have a pre-commit hook that will automatically do this on master,
likely often enough to work in practice, without needing pull requests
to include it.
This commit is contained in:
John Kessenich
2015-08-01 17:10:02 -06:00
parent e766fac3ea
commit 0da9eaabe8
3 changed files with 18 additions and 14 deletions

View File

@@ -39,6 +39,7 @@
#include "Worklist.h"
#include "./../glslang/Include/ShHandle.h"
#include "./../glslang/Include/revision.h"
#include "./../glslang/Public/ShaderLang.h"
#include "../SPIRV/GlslangToSpv.h"
#include "../SPIRV/GLSL450Lib.h"
@@ -782,12 +783,13 @@ int C_DECL main(int argc, char* argv[])
return ESuccess;
}
if (Options & EOptionDumpVersions) {
if (Options & EOptionDumpVersions) {
printf("Glslang Version: %s %s\n", GLSLANG_REVISION, GLSLANG_DATE);
printf("ESSL Version: %s\n", glslang::GetEsslVersionString());
printf("GLSL Version: %s\n", glslang::GetGlslVersionString());
std::string spirvVersion;
glslang::GetSpirvVersion(spirvVersion);
printf("SPIR-V Version %s\n", spirvVersion.c_str()); // TODO: move to consume source-generated data
printf("SPIR-V Version %s\n", spirvVersion.c_str());
if (Worklist.empty())
return ESuccess;
}

View File

@@ -1,13 +1,6 @@
// The file revision.h should be updated to the latest version, somehow, on
// check-in, if glslang has changed.
//
// revision.template is the source for revision.h when using SubWCRev as the
// method of updating revision.h. You don't have to do it this way, the
// requirement is only that revision.h gets updated.
//
// revision.h is under source control so that not all consumers of glslang
// source have to figure out how to create revision.h just to get a build
// going. However, if it is not updated, it can be a version behind.
// This header is generated by the make-revision script.
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "25512"
#define GLSLANG_DATE "2014/02/24 14:36:08"
#define GLSLANG_REVISION "2.1.686"
#define GLSLANG_DATE "02-Aug-2015"

9
make-revision Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/sh
echo "// This header is generated by the make-revision script."
echo "// For the version, it uses the latest git tag followed by the number of commits."
echo "// For the date, it uses the current date (when then script is run)."
echo
echo \#define GLSLANG_REVISION \"`git describe --tags --abbrev=0`.`git log --oneline | wc -l`\"
echo \#define GLSLANG_DATE \"`date +%d-%b-%Y`\"