From aa0adcdb7cb758122a7c8370566aa5fc516d24e8 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Thu, 28 Jul 2022 12:44:54 -0700 Subject: [PATCH] Compute rather than hardcode the host output suffix (flutter/engine#34978) --- engine/src/flutter/lib/snapshot/BUILD.gn | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/engine/src/flutter/lib/snapshot/BUILD.gn b/engine/src/flutter/lib/snapshot/BUILD.gn index c807acf1b13..2c05b6cc4ff 100644 --- a/engine/src/flutter/lib/snapshot/BUILD.gn +++ b/engine/src/flutter/lib/snapshot/BUILD.gn @@ -205,18 +205,16 @@ bin_to_linkable("platform_strong_dill_linkable") { if (host_os == "mac" && (target_cpu == "arm" || target_cpu == "arm64")) { action("create_arm_gen_snapshot") { - if (host_cpu == "arm64") { - clang_dir = "clang_arm64" - } else { - clang_dir = "clang_x64" - } - output_dir = "$root_out_dir/$clang_dir" + host_output_dir = get_label_info( + "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)", + "root_out_dir") + clang_dir = rebase_path(host_output_dir, root_build_dir) script = "//flutter/sky/tools/create_macos_gen_snapshots.py" visibility = [ ":*" ] deps = [ "//third_party/dart/runtime/bin:gen_snapshot($host_toolchain)" ] args = [ "--dst", - rebase_path(output_dir), + rebase_path(host_output_dir), "--clang-dir", clang_dir, ] @@ -225,13 +223,13 @@ if (host_os == "mac" && (target_cpu == "arm" || target_cpu == "arm64")) { "--armv7-out-dir", rebase_path("$root_out_dir"), ] - outputs = [ "$output_dir/gen_snapshot_armv7" ] + outputs = [ "$host_output_dir/gen_snapshot_armv7" ] } else { args += [ "--arm64-out-dir", rebase_path("$root_out_dir"), ] - outputs = [ "$output_dir/gen_snapshot_arm64" ] + outputs = [ "$host_output_dir/gen_snapshot_arm64" ] } } }