From ce5fd43b0c9c60ad85e7c5a54161b37897640ea6 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 28 Aug 2019 16:29:40 -0400 Subject: Support for getting git version from IGlobalSession (#1040) * Added slang-tag-version.h and travis code to generate the file. * Generate slang-tag-version.h on appveyor. * Move where slang-tag-version.h is generated on appveyor. * Dump slang-tag-version.h to console on travis. * Cat slang-tag-version.h * Added method getBuildTagVersion to IGlobalSession. Added -v option. --- slang.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'slang.h') diff --git a/slang.h b/slang.h index 6a6ddd0d0..4d775ac45 100644 --- a/slang.h +++ b/slang.h @@ -2669,6 +2669,15 @@ namespace slang virtual SLANG_NO_THROW void SLANG_MCALL setDownstreamCompilerPrelude( SlangPassThrough passThrough, const char* preludeText) = 0; + + /** Get the build version 'tag' string. The string is the same as produced via `git describe --tags` + for the project. If Slang is built separately from the automated build scripts + the contents will by default be 'unknown'. Any string can be set by changing the + contents of 'slang-tag-version.h' file and recompiling the project. + + @return The build tag string + */ + virtual SLANG_NO_THROW const char* SLANG_MCALL getBuildTagString() = 0; }; #define SLANG_UUID_IGlobalSession { 0xc140b5fd, 0xc78, 0x452e, { 0xba, 0x7c, 0x1a, 0x1e, 0x70, 0xc7, 0xf7, 0x1c } }; -- cgit v1.2.3