summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-compiler.h2
-rw-r--r--source/slang/slang-options.cpp4
-rw-r--r--source/slang/slang.cpp6
3 files changed, 12 insertions, 0 deletions
diff --git a/source/slang/slang-compiler.h b/source/slang/slang-compiler.h
index a6be59c76..0b97e2af7 100644
--- a/source/slang/slang-compiler.h
+++ b/source/slang/slang-compiler.h
@@ -1807,6 +1807,8 @@ namespace Slang
SlangPassThrough inPassThrough,
char const* prelude) override;
+ SLANG_NO_THROW const char* SLANG_MCALL getBuildTagString() override;
+
enum class SharedLibraryFuncType
{
Glslang_Compile,
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp
index a55322d31..94f82ef31 100644
--- a/source/slang/slang-options.cpp
+++ b/source/slang/slang-options.cpp
@@ -800,6 +800,10 @@ struct OptionsParser
return SLANG_FAIL;
}
}
+ else if (argStr == "-v")
+ {
+ sink->diagnoseRaw(Severity::Note, session->getBuildTagString());
+ }
else if (argStr == "--")
{
// The `--` option causes us to stop trying to parse options,
diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp
index 601312def..da04587fd 100644
--- a/source/slang/slang.cpp
+++ b/source/slang/slang.cpp
@@ -1,4 +1,5 @@
#include "../../slang.h"
+#include "../../slang-tag-version.h"
#include "../core/slang-io.h"
#include "../core/slang-string-util.h"
@@ -201,6 +202,11 @@ SLANG_NO_THROW void SLANG_MCALL Session::setDownstreamCompilerPrelude(
m_downstreamCompilerPreludes[int(passThrough)] = prelude;
}
+SLANG_NO_THROW const char* SLANG_MCALL Session::getBuildTagString()
+{
+ return SLANG_TAG_VERSION;
+}
+
struct IncludeHandlerImpl : IncludeHandler
{
Linkage* linkage;