summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-compiler.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-05-03 18:02:31 -0700
committerGitHub <noreply@github.com>2024-05-03 18:02:31 -0700
commit59903ef7e4ddd8885f71567bf0fc85527a88fffc (patch)
tree700a177860d24610780390b35277aa8ff5c47947 /source/slang/slang-compiler.cpp
parent54153a3681c7c6ef86c6f7a864719d32a1934240 (diff)
Add host shared library target. (#4098)
* Add host shared library target. * Attempt fix. * Fix warnings. * try fix. * Fix test. * Fix.
Diffstat (limited to 'source/slang/slang-compiler.cpp')
-rw-r--r--source/slang/slang-compiler.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/slang/slang-compiler.cpp b/source/slang/slang-compiler.cpp
index 1f1bed902..b2b765c0e 100644
--- a/source/slang/slang-compiler.cpp
+++ b/source/slang/slang-compiler.cpp
@@ -539,6 +539,7 @@ namespace Slang
case CodeGenTarget::ShaderSharedLibrary:
case CodeGenTarget::HostExecutable:
case CodeGenTarget::HostHostCallable:
+ case CodeGenTarget::HostSharedLibrary:
{
// We need some C/C++ compiler
return PassThroughMode::GenericCCpp;
@@ -955,6 +956,7 @@ namespace Slang
}
case CodeGenTarget::HostHostCallable:
case CodeGenTarget::HostExecutable:
+ case CodeGenTarget::HostSharedLibrary:
{
return CodeGenTarget::HostCPPSource;
}
@@ -1279,8 +1281,14 @@ namespace Slang
// Set the source type
options.sourceLanguage = SlangSourceLanguage(sourceLanguage);
- // Disable exceptions and security checks
- options.flags &= ~(CompileOptions::Flag::EnableExceptionHandling | CompileOptions::Flag::EnableSecurityChecks);
+ switch (target)
+ {
+ case CodeGenTarget::ShaderHostCallable:
+ case CodeGenTarget::ShaderSharedLibrary:
+ // Disable exceptions and security checks
+ options.flags &= ~(CompileOptions::Flag::EnableExceptionHandling | CompileOptions::Flag::EnableSecurityChecks);
+ break;
+ }
Profile profile;
@@ -1586,6 +1594,7 @@ namespace Slang
case CodeGenTarget::ShaderSharedLibrary:
case CodeGenTarget::HostExecutable:
case CodeGenTarget::HostHostCallable:
+ case CodeGenTarget::HostSharedLibrary:
SLANG_RETURN_ON_FAIL(emitWithDownstreamForEntryPoints(outArtifact));
return SLANG_OK;
@@ -1617,6 +1626,7 @@ namespace Slang
case CodeGenTarget::ShaderHostCallable:
case CodeGenTarget::ShaderSharedLibrary:
case CodeGenTarget::HostExecutable:
+ case CodeGenTarget::HostSharedLibrary:
{
SLANG_RETURN_ON_FAIL(_emitEntryPoints(outArtifact));