@@ -21,28 +21,43 @@ source_set("test_font") {
2121 }
2222}
2323
24+ is_profile_or_release =
25+ flutter_runtime_mode == " profile" || flutter_runtime_mode == " release"
26+
27+ # Fuchsia is special in that it does not use Flutter's policy of using JIT in
28+ # debug runtime mode and AOT in the profile and release modes. This is to
29+ # accommodate various runner configurations. :libdart allows for this by
30+ # not linking in a runtime and deferring that responsibility to the target.
31+ # However, all other non-runner target are now left with having to decide how to
32+ # link in a VM.
33+ group (" libdart_flutter_policy" ) {
34+ public_deps = []
35+
36+ # Flutter use AOT in profile or release and JIT in debug.
37+ if (is_profile_or_release ) {
38+ public_deps += [ " //third_party/dart/runtime:libdart_precompiled_runtime" ]
39+ } else {
40+ public_deps += [ " //third_party/dart/runtime:libdart_jit" ]
41+ }
42+
43+ # Instead of packaging the VM and isolate snapshots separately along with the
44+ # AOT blob, JIT variants look for these assets in the binary itself.
45+ if (! is_profile_or_release ) {
46+ public_deps += [ " //flutter/lib/snapshot" ]
47+ }
48+ }
49+
2450# Picks the libdart implementation based on the Flutter runtime mode.
2551group (" libdart" ) {
2652 public_deps = []
2753
28- is_profile_or_release =
29- flutter_runtime_mode == " profile" || flutter_runtime_mode == " release"
30-
3154 # Whether Fuchsia uses JIT or AOT does not depend on the runtime mode. Instead
3255 # multiple runner variants are built and those runners explicitly link in the
3356 # right variant of the VM.
3457 if (! is_fuchsia ) {
35- # Flutter use AOT in profile or release and JIT in debug.
36- if (is_profile_or_release ) {
37- public_deps +=
38- [ " //third_party/dart/runtime:libdart_precompiled_runtime" ]
39- } else {
40- public_deps += [ " //third_party/dart/runtime:libdart_jit" ]
41- }
58+ public_deps += [ " :libdart_flutter_policy" ]
4259 }
4360
44- # Instead of packaging the VM and isolate snapshots separately along with the
45- # AOT blob, JIT variants look for these assets in the binary itself.
4661 if (! is_profile_or_release ) {
4762 public_deps += [ " //flutter/lib/snapshot" ]
4863 }
0 commit comments