From f2e325758ba4aae40dd15689f3d3c8a090ef2603 Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 5 Mar 2024 13:11:17 -0800 Subject: [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. --- source/slang/slang-options.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source') 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; -- cgit v1.2.3