Skip to content

Commit 261a603

Browse files
Add UseInterpreter as part of the check for DynamicCodeSupport (#20912)
fixes: dotnet/maui#23577 ## Cause: `MtouchInterpreter` is set as https://github.com/xamarin/xamarin-macios/blob/d1ec7a793f46f615f5f08f0a60f4c6daa6a1b671/msbuild/Xamarin.Shared/Xamarin.Shared.props#L308 `DynamicCodeSupport` is set by https://github.com/xamarin/xamarin-macios/blob/d1ec7a793f46f615f5f08f0a60f4c6daa6a1b671/dotnet/targets/Xamarin.Shared.Sdk.targets#L146 `Xamarin.Shared.Sdk.targets` is imported *before* `Xamarin.Shared.props` as shown below (courtesy of @ivanpovazan) <img src="https://github.com/user-attachments/assets/c97b7f01-2372-4f9d-bedf-83060eed1c50"> so unless the value of `MtouchInterpreter` is set in the project, it's value will be empty when the `DynamicCodeSupport` property is evaluated. ## Resolution: To minimize the impact of this change, until it can be investigated more fully, the value of `MtouchInterpreter` is evaluated as https://github.com/xamarin/xamarin-macios/blob/d1ec7a793f46f615f5f08f0a60f4c6daa6a1b671/msbuild/Xamarin.Shared/Xamarin.Shared.props#L308 So adding `( '$(MtouchInterpreter)' == '' And '$(UseInterpreter)' == 'false' )` to the definition of `DynamicCodeSupport` to match the `MtouchInterpreter` definition. A further fix might be to either: 1. Reorder the imports so that the props are included before the targets, although the ramifications of that change could be significant 2. Move the definition of `DynamicCodeSupport` to `Xamarin.Shared.props`. This at first glance seems to be less significant than 1) but would need review and testing. --------- Co-authored-by: Ivan Povazan <55002338+ivanpovazan@users.noreply.github.com>
1 parent 54ed26c commit 261a603

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dotnet/targets/Xamarin.Shared.Sdk.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
<VerifyDependencyInjectionOpenGenericServiceTrimmability Condition="'$(VerifyDependencyInjectionOpenGenericServiceTrimmability)' == '' And '$(_BundlerDebug)' != 'true'">false</VerifyDependencyInjectionOpenGenericServiceTrimmability>
144144
<VerifyDependencyInjectionOpenGenericServiceTrimmability Condition="'$(VerifyDependencyInjectionOpenGenericServiceTrimmability)' == ''">true</VerifyDependencyInjectionOpenGenericServiceTrimmability>
145145
<!-- This should be set by dotnet/sdk instead, once https://github.com/dotnet/sdk/issues/25392 gets resolved. -->
146-
<DynamicCodeSupport Condition="'$(DynamicCodeSupport)' == '' And '$(MtouchInterpreter)' == '' And ('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'MacCatalyst')">false</DynamicCodeSupport>
146+
<DynamicCodeSupport Condition="'$(DynamicCodeSupport)' == '' And ( '$(MtouchInterpreter)' == '' And '$(UseInterpreter)' != 'true' ) And ('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'MacCatalyst')">false</DynamicCodeSupport>
147147

148148
<!-- We don't need to generate reference assemblies for apps or app extensions -->
149149
<ProduceReferenceAssembly Condition="'$(ProduceReferenceAssembly)' == '' And ('$(OutputType)' == 'Exe' Or '$(IsAppExtension)' == 'true')">false</ProduceReferenceAssembly>

0 commit comments

Comments
 (0)