summaryrefslogtreecommitdiff
path: root/source/slang-core-module/slang-embedded-core-module.cpp
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2024-10-28 15:47:00 -0700
committerGitHub <noreply@github.com>2024-10-28 15:47:00 -0700
commit80471601720e107f0914479f6097281d0840cf18 (patch)
tree368a81a34926bd321f29f4c091f0110aa729e0ba /source/slang-core-module/slang-embedded-core-module.cpp
parentb61be5e6fb7fe1c4ec8228cdf73f49f11e5a0ac9 (diff)
Rename a directory `source/slang-stdlib` to slang-core-module (#5417)
The directory name of `source/slang-stdlib` is changed to `source/slang-core-module`. We will use the term "core module" instead of "standard library" from now on.
Diffstat (limited to 'source/slang-core-module/slang-embedded-core-module.cpp')
-rw-r--r--source/slang-core-module/slang-embedded-core-module.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/slang-core-module/slang-embedded-core-module.cpp b/source/slang-core-module/slang-embedded-core-module.cpp
new file mode 100644
index 000000000..ceebcb940
--- /dev/null
+++ b/source/slang-core-module/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