From 08de73a5da92f722c53ae9ae8fab4139186ffcf8 Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Wed, 1 May 2024 18:29:39 -0700 Subject: Copy default target's optionSet to code-gen target's optionSet (#4073) In current implementation, the some options will be to added to the target that is only specified by command line "-target". But if user specifies the target by just using slang API, e.g. 'spAddCodeGenTarget', those options will be missed. To fix the problem, we copy the default target's options to the code-gen target's option set. The default target will only be useful when there is no target specified in the command line. --- source/slang/slang.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 5974656df..9b612b340 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -5529,6 +5529,7 @@ void EndToEndCompileRequest::_completeTargetRequest(UInt targetIndex) TargetRequest* targetRequest = linkage->targets[Index(targetIndex)]; targetRequest->getOptionSet().inheritFrom(getLinkage()->m_optionSet); + targetRequest->getOptionSet().inheritFrom(m_optionSetForDefaultTarget); } void EndToEndCompileRequest::setCodeGenTarget(SlangCompileTarget target) -- cgit v1.2.3