summaryrefslogtreecommitdiffstats
path: root/source/slang-stdlib/slang-embedded-core-module.cpp
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2024-10-25 15:59:17 -0700
committerGitHub <noreply@github.com>2024-10-25 15:59:17 -0700
commitd8969d87dcc9eea3f186a0c93c5e48d3d1659e05 (patch)
treea7c17a8d8ce08bdd1551ba4815de809a4d1783f6 /source/slang-stdlib/slang-embedded-core-module.cpp
parent4bad669bbc5ec3ff77321f083c59cde87eb10229 (diff)
Replace stdlib with core-module on files and projects (#5411)
This commit renames the files and projects to prefer "core-module" over "stdlib". The directory name `source/slang-stdlib` needs to be renamed too, and there will be another commit for it soon.
Diffstat (limited to 'source/slang-stdlib/slang-embedded-core-module.cpp')
-rw-r--r--source/slang-stdlib/slang-embedded-core-module.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/slang-stdlib/slang-embedded-core-module.cpp b/source/slang-stdlib/slang-embedded-core-module.cpp
new file mode 100644
index 000000000..ceebcb940
--- /dev/null
+++ b/source/slang-stdlib/slang-embedded-core-module.cpp
@@ -0,0 +1,26 @@
+#include "../core/slang-basic.h"
+#include "../core/slang-array-view.h"
+#include "../core/slang-blob.h"
+
+#ifdef SLANG_EMBED_CORE_MODULE
+
+static const uint8_t g_coreModule[] =
+{
+# include "slang-core-module-generated.h"
+};
+
+static Slang::StaticBlob g_coreModuleBlob((const void*)g_coreModule, sizeof(g_coreModule));
+
+SLANG_API ISlangBlob* slang_getEmbeddedCoreModule()
+{
+ return &g_coreModuleBlob;
+}
+
+#else
+
+SLANG_API ISlangBlob* slang_getEmbeddedCoreModule()
+{
+ return nullptr;
+}
+
+#endif