diff options
| author | Yong He <yonghe@outlook.com> | 2024-03-05 13:11:17 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-05 13:11:17 -0800 |
| commit | f2e325758ba4aae40dd15689f3d3c8a090ef2603 (patch) | |
| tree | 2ac21b409b5b7038afaa0a4bfeccdc92c11adef1 /source/slang | |
| parent | 8d4b659b4d95fb72f4c483f6327acd60b44268bc (diff) | |
[slangc] generate an error when `-entry` is not specified for targets that require them. (#3679)
* [slangc] generate an error when `-entry` is not specified for targets that require them.
* Fix.
* Fix.
Diffstat (limited to 'source/slang')
| -rw-r--r-- | source/slang/slang-options.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/slang/slang-options.cpp b/source/slang/slang-options.cpp index 5e009c46e..6b56d5600 100644 --- a/source/slang/slang-options.cpp +++ b/source/slang/slang-options.cpp @@ -2822,8 +2822,14 @@ SlangResult OptionsParser::_parse( if (getCurrentTarget()->optionSet.shouldEmitSPIRVDirectly()) { rawOutput.isWholeProgram = true; + break; } - break; + else if (m_rawEntryPoints.getCount() != 0) + { + rawOutput.entryPointIndex = (int)m_rawEntryPoints.getCount() - 1; + break; + } + [[fallthrough]]; default: m_sink->diagnose(SourceLoc(), Diagnostics::cannotMatchOutputFileToEntryPoint, rawOutput.path); break; |
