From 2e8d995cb6dea25110f7b2a11f5d05dbfdc45ca3 Mon Sep 17 00:00:00 2001 From: godofredoc Date: Mon, 14 Nov 2022 14:54:53 -0800 Subject: [PATCH] Archive windows gen_snapshot.exe. (flutter/engine#35414) * Archive windows gen_snapshot.exe. This is required to enable engine_v2 recipes for windows platform. Bug: https://github.com/flutter/flutter/issues/81855 * Add dep to generate gen_snapshot.exe. * Use target platform name rather than host. * Use prebuilt_arch. * Use platform_name instead of is_win. * Remove android check. * Fix output name. * Separate platform and cpu in name. * Remove failing line. * Use dart_target_arch rather than target_cpu in windows. * Add dart_target_arch to scope. * Add support for android_cpu. * Fix android_cpu variable name. * Rebase to ToT * Try to use target cpu directly. * Use host os instead of is_win. * Build engine artifacts for win. * Update build/archives/BUILD.gn Co-authored-by: Zachary Anderson * Update build/archives/BUILD.gn Co-authored-by: Zachary Anderson * Update build/archives/BUILD.gn Co-authored-by: Zachary Anderson Co-authored-by: Zachary Anderson --- engine/src/flutter/build/archives/BUILD.gn | 13 +++++++++++++ engine/src/flutter/common/config.gni | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/build/archives/BUILD.gn b/engine/src/flutter/build/archives/BUILD.gn index 7743e1ad911..90993ddb427 100644 --- a/engine/src/flutter/build/archives/BUILD.gn +++ b/engine/src/flutter/build/archives/BUILD.gn @@ -300,3 +300,16 @@ if (is_mac) { ] } } + +if (host_os == "win") { + zip_bundle("archive_win_gen_snapshot") { + deps = [ "//flutter:gen_snapshot" ] + output = "$full_target_platform_name-$flutter_runtime_mode/windows-x64.zip" + files = [ + { + source = "$root_out_dir/gen_snapshot/gen_snapshot.exe" + destination = "gen_snapshot.exe" + }, + ] + } +} diff --git a/engine/src/flutter/common/config.gni b/engine/src/flutter/common/config.gni index affe61af22d..afb8f0b2b2c 100644 --- a/engine/src/flutter/common/config.gni +++ b/engine/src/flutter/common/config.gni @@ -132,4 +132,4 @@ if (flutter_prebuilt_dart_sdk) { # see https://github.com/flutter/flutter/issues/74322 build_engine_artifacts = current_toolchain == host_toolchain || - (is_linux && !is_chromeos && current_cpu != "arm") || is_mac + (is_linux && !is_chromeos && current_cpu != "arm") || is_mac || is_win