diff --git a/samples/embedder/BUILD.gn b/samples/embedder/BUILD.gn index 27482072534..4e93d215b6a 100644 --- a/samples/embedder/BUILD.gn +++ b/samples/embedder/BUILD.gn @@ -15,22 +15,30 @@ group("all") { group("aot") { deps = [ - ":run_futures_aot", ":run_main_aot", ":run_timer_aot", ":run_timer_async_aot", ":run_two_programs_aot", ] + + # FFI can't execute on the VM's simulator + if (dart_target_arch == host_cpu) { + deps += [ ":run_futures_aot" ] + } } group("kernel") { deps = [ - ":run_futures_kernel", ":run_main_kernel", ":run_timer_async_kernel", ":run_timer_kernel", ":run_two_programs_kernel", ] + + # FFI can't execute on the VM's simulator + if (dart_target_arch == host_cpu) { + deps += [ ":run_futures_kernel" ] + } } # Generates a pair of executables for kernel and AOT snapshots. @@ -153,11 +161,14 @@ snapshots("timer") { main_dart = "timer.dart" } -snapshots("futures") { - main_dart = "futures.dart" -} +# FFI can't execute on the VM's simulator +if (dart_target_arch == host_cpu) { + snapshots("futures") { + main_dart = "futures.dart" + } -sample("run_futures") { - sources = [ "run_futures.cc" ] - snapshots = [ ":futures" ] + sample("run_futures") { + sources = [ "run_futures.cc" ] + snapshots = [ ":futures" ] + } } diff --git a/tests/standalone/embedder_samples_test.dart b/tests/standalone/embedder_samples_test.dart index eeff1382d4a..40d9009d8b0 100644 --- a/tests/standalone/embedder_samples_test.dart +++ b/tests/standalone/embedder_samples_test.dart @@ -44,9 +44,10 @@ void main() { checkSample('$out/run_timer_async_kernel', [ '$out/gen/timer_kernel.dart.snapshot', ]); + // FFI samples aren't built on some platforms. checkSample('$out/run_futures_kernel', [ '$out/gen/futures_kernel.dart.snapshot', - ]); + ], skipIfNotBuilt: true); // AOT Samples aren't built on some platforms. checkSample('$out/run_main_aot', [