Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 7204b57

Browse files
committed
Fuuuuuuuschiaaaaaaaaaaaa!!!!
1 parent 6066016 commit 7204b57

4 files changed

Lines changed: 35 additions & 18 deletions

File tree

benchmarking/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ source_set("benchmarking") {
1616

1717
public_deps = [
1818
"//flutter/fml",
19+
"//flutter/runtime:libdart_flutter_policy",
1920
"//third_party/benchmark",
2021
]
2122

fml/BUILD.gn

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ source_set("fml") {
191191
"$fuchsia_sdk_root/pkg:trace-engine",
192192
"$fuchsia_sdk_root/pkg:zx",
193193
]
194+
195+
libs +=
196+
[ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ]
194197
}
195198

196199
if (is_win) {
@@ -282,10 +285,5 @@ if (enable_unittests) {
282285
"//flutter/fml/dart",
283286
"//flutter/testing",
284287
]
285-
286-
if (is_fuchsia) {
287-
libs =
288-
[ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ]
289-
}
290288
}
291289
}

runtime/BUILD.gn

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
2551
group("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
}

testing/BUILD.gn

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ source_set("testing") {
3737
"test_timeout_listener.h",
3838
]
3939

40-
public_deps = [ ":testing_lib" ]
40+
public_deps = [
41+
":testing_lib",
42+
"//flutter/runtime:libdart_flutter_policy",
43+
]
4144
}
4245

4346
source_set("dart") {

0 commit comments

Comments
 (0)