From d7525a5efc237fda88c032b38c63287ee3a70b57 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Thu, 9 May 2019 14:14:52 -0700 Subject: [PATCH] [fuchsia] Guard out-of-tree Fuchsia targets to fix in-tree build (flutter/engine#8923) --- engine/src/flutter/shell/platform/BUILD.gn | 10 +- .../flutter/shell/platform/fuchsia/BUILD.gn | 162 +++++++++--------- 2 files changed, 89 insertions(+), 83 deletions(-) diff --git a/engine/src/flutter/shell/platform/BUILD.gn b/engine/src/flutter/shell/platform/BUILD.gn index e7669216b39..ac7e1095f5d 100644 --- a/engine/src/flutter/shell/platform/BUILD.gn +++ b/engine/src/flutter/shell/platform/BUILD.gn @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/fuchsia/sdk.gni") + group("platform") { if (is_mac || is_ios) { deps = [ @@ -26,9 +28,11 @@ group("platform") { ] } else if (is_fuchsia) { # Fuchsia has its own runner implementation. - deps = [ - "fuchsia", - ] + if (using_fuchsia_sdk) { + deps = [ + "fuchsia", + ] + } } else { assert(false, "Unknown/Unsupported platform.") } diff --git a/engine/src/flutter/shell/platform/fuchsia/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/BUILD.gn index 5c55bcf5834..d1c8dda34ee 100644 --- a/engine/src/flutter/shell/platform/fuchsia/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/BUILD.gn @@ -6,86 +6,88 @@ assert(is_fuchsia) import("//build/fuchsia/sdk.gni") -executable("fuchsia") { - output_name = "four_gate" +if (using_fuchsia_sdk) { + executable("fuchsia") { + output_name = "four_gate" - sources = [ - "component.cc", - "component.h", - "compositor_context.cc", - "compositor_context.h", - "context_writer_bridge.cc", - "context_writer_bridge.h", - "engine.cc", - "engine.h", - "fuchsia_font_manager.cc", - "fuchsia_font_manager.h", - "isolate_configurator.cc", - "isolate_configurator.h", - "logging.h", - "loop.cc", - "loop.h", - "main.cc", - "platform_view.cc", - "platform_view.h", - "runner.cc", - "runner.h", - "runner_context.cc", - "runner_context.h", - "service_provider_dir.cc", - "service_provider_dir.h", - "session_connection.cc", - "session_connection.h", - "surface.cc", - "surface.h", - "task_observers.cc", - "task_observers.h", - "task_runner_adapter.cc", - "task_runner_adapter.h", - "thread.cc", - "thread.h", - "unique_fdio_ns.h", - "vsync_recorder.cc", - "vsync_recorder.h", - "vsync_waiter.cc", - "vsync_waiter.h", - "vulkan_surface.cc", - "vulkan_surface.h", - "vulkan_surface_pool.cc", - "vulkan_surface_pool.h", - "vulkan_surface_producer.cc", - "vulkan_surface_producer.h", - ] + sources = [ + "component.cc", + "component.h", + "compositor_context.cc", + "compositor_context.h", + "context_writer_bridge.cc", + "context_writer_bridge.h", + "engine.cc", + "engine.h", + "fuchsia_font_manager.cc", + "fuchsia_font_manager.h", + "isolate_configurator.cc", + "isolate_configurator.h", + "logging.h", + "loop.cc", + "loop.h", + "main.cc", + "platform_view.cc", + "platform_view.h", + "runner.cc", + "runner.h", + "runner_context.cc", + "runner_context.h", + "service_provider_dir.cc", + "service_provider_dir.h", + "session_connection.cc", + "session_connection.h", + "surface.cc", + "surface.h", + "task_observers.cc", + "task_observers.h", + "task_runner_adapter.cc", + "task_runner_adapter.h", + "thread.cc", + "thread.h", + "unique_fdio_ns.h", + "vsync_recorder.cc", + "vsync_recorder.h", + "vsync_waiter.cc", + "vsync_waiter.h", + "vulkan_surface.cc", + "vulkan_surface.h", + "vulkan_surface_pool.cc", + "vulkan_surface_pool.h", + "vulkan_surface_producer.cc", + "vulkan_surface_producer.h", + ] - deps = [ - "$flutter_root/common", - "$flutter_root/flow", - "$flutter_root/fml", - "$flutter_root/lib/ui", - "$flutter_root/runtime", - "$flutter_root/runtime:libdart", - "$flutter_root/shell/common", - "$flutter_root/vulkan", - "$fuchsia_sdk_root/fidl:fuchsia.fonts", - "$fuchsia_sdk_root/fidl:fuchsia.images", - "$fuchsia_sdk_root/fidl:fuchsia.io", - "$fuchsia_sdk_root/fidl:fuchsia.modular", - "$fuchsia_sdk_root/fidl:fuchsia.sys", - "$fuchsia_sdk_root/fidl:fuchsia.ui.app", - "$fuchsia_sdk_root/fidl:fuchsia.ui.scenic", - "$fuchsia_sdk_root/pkg:async-cpp", - "$fuchsia_sdk_root/pkg:async-loop", - "$fuchsia_sdk_root/pkg:async-loop-cpp", - "$fuchsia_sdk_root/pkg:fdio", - "$fuchsia_sdk_root/pkg:fidl_cpp", - "$fuchsia_sdk_root/pkg:scenic_cpp", - "$fuchsia_sdk_root/pkg:syslog", - "$fuchsia_sdk_root/pkg:zx", - "$fuchsia_sdk_root/pkg/lib/sys/cpp", - "$fuchsia_sdk_root/pkg/lib/vfs/cpp", - "dart-pkg/fuchsia", - "dart-pkg/zircon", - "runtime/dart/utils", - "//third_party/tonic", - ] + deps = [ + "$flutter_root/common", + "$flutter_root/flow", + "$flutter_root/fml", + "$flutter_root/lib/ui", + "$flutter_root/runtime", + "$flutter_root/runtime:libdart", + "$flutter_root/shell/common", + "$flutter_root/vulkan", + "$fuchsia_sdk_root/fidl:fuchsia.fonts", + "$fuchsia_sdk_root/fidl:fuchsia.images", + "$fuchsia_sdk_root/fidl:fuchsia.io", + "$fuchsia_sdk_root/fidl:fuchsia.modular", + "$fuchsia_sdk_root/fidl:fuchsia.sys", + "$fuchsia_sdk_root/fidl:fuchsia.ui.app", + "$fuchsia_sdk_root/fidl:fuchsia.ui.scenic", + "$fuchsia_sdk_root/pkg:async-cpp", + "$fuchsia_sdk_root/pkg:async-loop", + "$fuchsia_sdk_root/pkg:async-loop-cpp", + "$fuchsia_sdk_root/pkg:fdio", + "$fuchsia_sdk_root/pkg:fidl_cpp", + "$fuchsia_sdk_root/pkg:scenic_cpp", + "$fuchsia_sdk_root/pkg:syslog", + "$fuchsia_sdk_root/pkg:zx", + "$fuchsia_sdk_root/pkg/lib/sys/cpp", + "$fuchsia_sdk_root/pkg/lib/vfs/cpp", + "dart-pkg/fuchsia", + "dart-pkg/zircon", + "runtime/dart/utils", + "//third_party/tonic", + ] + } }