From dc18c5be1ae9a8f6c63d1d7d48a9d0522d9e65fd Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 1 Aug 2022 15:13:03 -0700 Subject: [PATCH] Fix detection of Mac target specification as a host build. (flutter/engine#35063) --- engine/src/flutter/tools/gn | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/tools/gn b/engine/src/flutter/tools/gn index 2cfc42920b..2b8e94f336 100755 --- a/engine/src/flutter/tools/gn +++ b/engine/src/flutter/tools/gn @@ -94,11 +94,17 @@ def cpu_for_target_arch(arch): def is_host_build(args): # If target_os == None, then this is a host build. - # However, for linux arm64 builds, we cross compile from x64 hosts, so the + if args.target_os is None: + return True + # For linux arm64 builds, we cross compile from x64 hosts, so the # target_os='linux' and linux-cpu='arm64' - return args.target_os is None or ( - args.target_os == 'linux' and args.linux_cpu == 'arm64' - ) + if args.target_os == 'linux' and args.linux_cpu == 'arm64': + return True + # The Mac and host targets are redundant. Again, necessary to disambiguate + # during cross-compilation. + if args.target_os == 'mac': + return True + return False # Determines whether a prebuilt Dart SDK can be used instead of building one.