From 1533f9c5ff62f68027c060a06dfb822750b58119 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 26 Mar 2019 11:38:35 -0700 Subject: [PATCH 1/2] Build Windows shell Enables the build of the Windows shell, based on the same GLFW code used by the current Linux shell. --- shell/platform/BUILD.gn | 9 +++++--- .../common/cpp/client_wrapper/publish.gni | 12 +++++++++- shell/platform/glfw/BUILD.gn | 6 +++++ shell/platform/windows/BUILD.gn | 22 +++++++++++++++++++ 4 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 shell/platform/windows/BUILD.gn diff --git a/shell/platform/BUILD.gn b/shell/platform/BUILD.gn index 206f997d9d04b..89b1bbabe6f4d 100644 --- a/shell/platform/BUILD.gn +++ b/shell/platform/BUILD.gn @@ -13,9 +13,12 @@ group("platform") { ] } else if (is_linux) { deps = [] - } else if (is_win || is_fuchsia) { - # There is no platform target on Windows. Fuchsia has its own runner - # implementation. + } else if (is_win) { + deps = [ + "windows", + ] + } else if ( is_fuchsia) { + # Fuchsia has its own runner implementation. deps = [] } else { assert(false, "Unknown/Unsupported platform.") diff --git a/shell/platform/common/cpp/client_wrapper/publish.gni b/shell/platform/common/cpp/client_wrapper/publish.gni index 8913062ced2f4..5483ab56a6a7c 100644 --- a/shell/platform/common/cpp/client_wrapper/publish.gni +++ b/shell/platform/common/cpp/client_wrapper/publish.gni @@ -23,7 +23,10 @@ template("publish_client_wrapper") { } copy("${template_target_name}_publish_includes") { - visibility = [ ":$template_target_name" ] + visibility = [ + ":$template_target_name", + ":${template_target_name}_publish_sources", + ] sources = invoker.public outputs = [ @@ -38,5 +41,12 @@ template("publish_client_wrapper") { outputs = [ "$publish_dir_root/{{source_file_part}}", ] + + # GN on Windows appears to do #include checks even for copy + # targets, so add the dependency to the headers to satisfy + # the check. + deps = [ + ":${template_target_name}_publish_includes", + ] } } diff --git a/shell/platform/glfw/BUILD.gn b/shell/platform/glfw/BUILD.gn index 5fa29fc02c717..91386e3b29f40 100644 --- a/shell/platform/glfw/BUILD.gn +++ b/shell/platform/glfw/BUILD.gn @@ -65,6 +65,12 @@ source_set("flutter_glfw") { "$flutter_root/shell/platform/linux/config:x11", ] } + + if (is_win) { + deps += [ + "//build/secondary/third_party/glfw", + ] + } } copy("publish_headers_glfw") { diff --git a/shell/platform/windows/BUILD.gn b/shell/platform/windows/BUILD.gn new file mode 100644 index 0000000000000..26fe53036b49a --- /dev/null +++ b/shell/platform/windows/BUILD.gn @@ -0,0 +1,22 @@ +# Copyright 2013 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +assert(is_win) + +group("windows") { + deps = [ + ":flutter_windows", + "$flutter_root/shell/platform/glfw:publish_headers_glfw", + "$flutter_root/shell/platform/common/cpp/client_wrapper:publish_wrapper", + "$flutter_root/shell/platform/glfw/client_wrapper:publish_wrapper_glfw", + ] +} + +shared_library("flutter_windows") { + deps = [ + "$flutter_root/shell/platform/glfw:flutter_glfw", + ] + + public_configs = [ "$flutter_root:config" ] +} From cf70041441a5b8196fef7922d394395413c9e4af Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 27 Mar 2019 20:01:57 -0700 Subject: [PATCH 2/2] Remove now-redundant Windows-specific GLFW dependency --- shell/platform/glfw/BUILD.gn | 6 ------ 1 file changed, 6 deletions(-) diff --git a/shell/platform/glfw/BUILD.gn b/shell/platform/glfw/BUILD.gn index 7618b0be78cec..478d2e80e3255 100644 --- a/shell/platform/glfw/BUILD.gn +++ b/shell/platform/glfw/BUILD.gn @@ -64,12 +64,6 @@ source_set("flutter_glfw") { "$flutter_root/shell/platform/linux/config:x11", ] } - - if (is_win) { - deps += [ - "//build/secondary/third_party/glfw", - ] - } } copy("publish_headers_glfw") {