@@ -10,11 +10,24 @@ import 'unsupported_vm_target.dart'
1010MacroConfiguration computeMacroConfiguration ({Uri ? targetSdkSummary}) {
1111 // Force the SDK summary to "vm_platform_strong.dill".
1212 // TODO(54404): make this sufficiently correct for all use cases.
13- Uri ? sdkSummary = (targetSdkSummary == null ||
14- targetSdkSummary.path == 'virtual_platform_kernel.dill' ||
15- targetSdkSummary.path.contains ('vm_platform_strong.dill' ))
16- ? targetSdkSummary
17- : targetSdkSummary.resolve ('./vm_platform_strong.dill' );
13+
14+ Uri ? sdkSummary;
15+ if ((targetSdkSummary == null ||
16+ targetSdkSummary.path == 'virtual_platform_kernel.dill' ||
17+ targetSdkSummary.path.contains ('vm_platform_strong.dill' ))) {
18+ sdkSummary = targetSdkSummary;
19+ } else if (targetSdkSummary.path.contains ('/platform_strong.dill' )) {
20+ // Flutter. Expecting the dill to be
21+ // bin/cache/artifacts/engine/common/flutter_patched_sdk/platform_strong.dill
22+ // and the Dart SDK to be under bin/cache/dart-sdk.
23+ sdkSummary = targetSdkSummary.resolve (
24+ './../../../../dart-sdk/lib/_internal/vm_platform_strong.dill' );
25+ } else {
26+ // Non-VM target platform, not Flutter. Find the platform dill next to the
27+ // non-VM platform dill.
28+ sdkSummary = targetSdkSummary.resolve ('./vm_platform_strong.dill' );
29+ }
30+
1831 return new MacroConfiguration (
1932 target: new VmTarget (
2033 new TargetFlags (soundNullSafety: true , supportMirrors: false )),
0 commit comments