summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2022-06-01 20:37:43 -0400
committerGitHub <noreply@github.com>2022-06-01 17:37:43 -0700
commit4f14efc9752d9ebc8538a2e29ed154a00dc99682 (patch)
treef7d46fdc611349ade0b5cc39c23fb83e00412598 /source
parent17e3b88b541ed7f45d575f0f9caaa808cd0a6619 (diff)
Disable stdlib source via premake (#2259)
* #include an absolute path didn't work - because paths were taken to always be relative. * Added ability to compile slang without stdlib source. It's not requried if stdlib is available if embedded, or is a binary on the file system. Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-stdlib.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp
index e0727f19a..2bbf3c1c0 100644
--- a/source/slang/slang-stdlib.cpp
+++ b/source/slang/slang-stdlib.cpp
@@ -225,6 +225,7 @@ namespace Slang
String Session::getCoreLibraryCode()
{
+#if !defined(SLANG_DISABLE_STDLIB_SOURCE)
if (coreLibraryCode.getLength() > 0)
return coreLibraryCode;
@@ -235,11 +236,14 @@ namespace Slang
#include "core.meta.slang.h"
coreLibraryCode = sb.ProduceString();
+#endif
+
return coreLibraryCode;
}
String Session::getHLSLLibraryCode()
{
+#if !defined(SLANG_DISABLE_STDLIB_SOURCE)
if (hlslLibraryCode.getLength() > 0)
return hlslLibraryCode;
@@ -250,6 +254,7 @@ namespace Slang
#include "hlsl.meta.slang.h"
hlslLibraryCode = sb.ProduceString();
+#endif
return hlslLibraryCode;
}
}