summaryrefslogtreecommitdiffstats
path: root/source/compiler-core
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-12-13 00:34:16 +0800
committerGitHub <noreply@github.com>2024-12-13 00:34:16 +0800
commit48ac6f25ff53290850a0edff0285dc3e1a350ad3 (patch)
tree2388d19d2943980c92a4a719d73a7f1fbbb750d9 /source/compiler-core
parent7279c0419409dfe609b0f147df0a7ab357559e69 (diff)
Correctly distinguish between windows and MSVC (#5851)
Partially sorts https://github.com/shader-slang/slang/issues/5843
Diffstat (limited to 'source/compiler-core')
-rw-r--r--source/compiler-core/windows/slang-win-visual-studio-util.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/compiler-core/windows/slang-win-visual-studio-util.cpp b/source/compiler-core/windows/slang-win-visual-studio-util.cpp
index e97a998d6..21830bd47 100644
--- a/source/compiler-core/windows/slang-win-visual-studio-util.cpp
+++ b/source/compiler-core/windows/slang-win-visual-studio-util.cpp
@@ -69,7 +69,7 @@ static SlangResult _readRegistryKey(const char* path, const char* keyName, Strin
// Make easier to set up the array
-static DownstreamCompilerMatchVersion _makeVersion(int main)
+[[maybe_unused]] static DownstreamCompilerMatchVersion _makeVersion(int main)
{
DownstreamCompilerMatchVersion version;
version.type = SLANG_PASS_THROUGH_VISUAL_STUDIO;
@@ -77,7 +77,7 @@ static DownstreamCompilerMatchVersion _makeVersion(int main)
return version;
}
-static DownstreamCompilerMatchVersion _makeVersion(int main, int dot)
+[[maybe_unused]] static DownstreamCompilerMatchVersion _makeVersion(int main, int dot)
{
DownstreamCompilerMatchVersion version;
version.type = SLANG_PASS_THROUGH_VISUAL_STUDIO;
@@ -149,6 +149,7 @@ static SlangResult _parseVersion(UnownedStringSlice versionString, SemanticVersi
/* static */ DownstreamCompilerMatchVersion WinVisualStudioUtil::getCompiledVersion()
{
+#ifdef _MSC_VER
// Get the version of visual studio used to compile this source
// Not const, because otherwise we get an warning/error about constant expression...
uint32_t version = _MSC_VER;
@@ -247,6 +248,7 @@ static SlangResult _parseVersion(UnownedStringSlice versionString, SemanticVersi
SLANG_PASS_THROUGH_VISUAL_STUDIO,
MatchSemanticVersion::makeFuture());
}
+#endif
// Unknown version
return DownstreamCompilerMatchVersion(SLANG_PASS_THROUGH_VISUAL_STUDIO, MatchSemanticVersion());