blob: 79e6a5ebbdef6c15b9d769134e23e3fa92cdd74d [file] [log] [blame]
# 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)
import("//flutter/shell/platform/glfw/config.gni")
import("//flutter/testing/testing.gni")
_public_headers = [ "public/flutter_windows.h" ]
config("relative_angle_headers") {
include_dirs = [ "//third_party/angle/include" ]
}
# Any files that are built by clients (client_wrapper code, library headers for
# implementations using this shared code, etc.) include the public headers
# assuming they are in the include path. This configuration should be added to
# any such code that is also built by GN to make the includes work.
config("relative_flutter_windows_headers") {
include_dirs = [ "public" ]
}
# The headers are a separate source set since the client wrapper is allowed
# to depend on the public headers, but none of the rest of the code.
source_set("flutter_windows_headers") {
public = _public_headers
public_deps = [ "//flutter/shell/platform/common:common_cpp_library_headers" ]
configs +=
[ "//flutter/shell/platform/common:desktop_library_implementation" ]
public_configs =
[ "//flutter/shell/platform/common:relative_flutter_library_headers" ]
}
source_set("flutter_windows_source") {
# Common Windows sources.
sources = [
"accessibility_bridge_delegate_win32.cc",
"accessibility_bridge_delegate_win32.h",
"angle_surface_manager.cc",
"angle_surface_manager.h",
"cursor_handler.cc",
"cursor_handler.h",
"direct_manipulation.cc",
"direct_manipulation.h",
"dpi_utils_win32.cc",
"dpi_utils_win32.h",
"event_watcher_win32.cc",
"event_watcher_win32.h",
"external_texture.h",
"external_texture_d3d.cc",
"external_texture_d3d.h",
"external_texture_pixelbuffer.cc",
"external_texture_pixelbuffer.h",
"flutter_key_map.g.cc",
"flutter_platform_node_delegate_win32.cc",
"flutter_platform_node_delegate_win32.h",
"flutter_project_bundle.cc",
"flutter_project_bundle.h",
"flutter_window_win32.cc",
"flutter_window_win32.h",
"flutter_windows.cc",
"flutter_windows_engine.cc",
"flutter_windows_engine.h",
"flutter_windows_texture_registrar.cc",
"flutter_windows_texture_registrar.h",
"flutter_windows_view.cc",
"flutter_windows_view.h",
"flutter_windows_win32.cc",
"keyboard_handler_base.h",
"keyboard_key_channel_handler.cc",
"keyboard_key_channel_handler.h",
"keyboard_key_embedder_handler.cc",
"keyboard_key_embedder_handler.h",
"keyboard_key_handler.cc",
"keyboard_key_handler.h",
"keyboard_manager_win32.cc",
"keyboard_manager_win32.h",
"keyboard_win32_common.cc",
"keyboard_win32_common.h",
"platform_handler.cc",
"platform_handler.h",
"platform_handler_win32.cc",
"platform_handler_win32.h",
"sequential_id_generator.cc",
"sequential_id_generator.h",
"settings_plugin.cc",
"settings_plugin.h",
"settings_plugin_win32.cc",
"settings_plugin_win32.h",
"system_utils.h",
"system_utils_win32.cc",
"task_runner.cc",
"task_runner.h",
"task_runner_win32.cc",
"task_runner_win32.h",
"task_runner_win32_window.cc",
"task_runner_win32_window.h",
"text_input_manager_win32.cc",
"text_input_manager_win32.h",
"text_input_plugin.cc",
"text_input_plugin.h",
"window.cc",
"window.h",
"window_binding_handler.h",
"window_binding_handler_delegate.h",
"window_proc_delegate_manager_win32.cc",
"window_proc_delegate_manager_win32.h",
"window_state.h",
]
libs = [
"dwmapi.lib",
"imm32.lib",
]
configs += [
"//flutter/shell/platform/common:desktop_library_implementation",
"//third_party/angle:gl_prototypes",
]
public_configs = [ ":relative_angle_headers" ]
defines = [ "FLUTTER_ENGINE_NO_PROTOTYPES" ]
public_deps = [
"//flutter/fml:string_conversion",
"//flutter/shell/platform/common:common_cpp_accessibility",
]
deps = [
":flutter_windows_headers",
"//flutter/fml:fml",
"//flutter/shell/platform/common:common_cpp",
"//flutter/shell/platform/common:common_cpp_input",
"//flutter/shell/platform/common:common_cpp_switches",
"//flutter/shell/platform/common/client_wrapper:client_wrapper",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/platform/windows/client_wrapper:client_wrapper_windows",
"//third_party/angle:libEGL_static", # the order of libEGL_static and
# libGLESv2_static is important.. if
# reversed, will cause a linker error
# DllMain already defined in
# LIBCMTD.lib
"//third_party/angle:libGLESv2_static",
"//third_party/rapidjson",
]
}
copy("publish_headers_windows") {
sources = _public_headers
outputs = [ "$root_out_dir/{{source_file_part}}" ]
# The Windows header assumes the presence of the common headers.
deps = [ "//flutter/shell/platform/common:publish_headers" ]
}
shared_library("flutter_windows") {
deps = [ ":flutter_windows_source" ]
public_configs = [ "//flutter:config" ]
}
test_fixtures("flutter_windows_fixtures") {
fixtures = []
}
executable("flutter_windows_unittests") {
testonly = true
# Common Windows test sources.
sources = [
"accessibility_bridge_delegate_win32_unittests.cc",
"direct_manipulation_unittests.cc",
"dpi_utils_win32_unittests.cc",
"flutter_project_bundle_unittests.cc",
"flutter_window_win32_unittests.cc",
"flutter_windows_engine_unittests.cc",
"flutter_windows_texture_registrar_unittests.cc",
"flutter_windows_view_unittests.cc",
"keyboard_key_channel_handler_unittests.cc",
"keyboard_key_embedder_handler_unittests.cc",
"keyboard_key_handler_unittests.cc",
"keyboard_win32_common_unittests.cc",
"keyboard_win32_unittests.cc",
"platform_handler_unittests.cc",
"platform_handler_win32_unittests.cc",
"sequential_id_generator_unittests.cc",
"settings_plugin_unittests.cc",
"system_utils_unittests.cc",
"task_runner_unittests.cc",
"testing/engine_modifier.h",
"testing/flutter_window_win32_test.cc",
"testing/flutter_window_win32_test.h",
"testing/mock_gl_functions.h",
"testing/mock_text_input_manager_win32.cc",
"testing/mock_text_input_manager_win32.h",
"testing/mock_window.cc",
"testing/mock_window.h",
"testing/mock_window_binding_handler.cc",
"testing/mock_window_binding_handler.h",
"testing/test_keyboard.cc",
"testing/test_keyboard.h",
"testing/test_keyboard_unittests.cc",
"testing/wm_builders.cc",
"testing/wm_builders.h",
"text_input_plugin_unittest.cc",
"window_proc_delegate_manager_win32_unittests.cc",
"window_unittests.cc",
]
public_configs = [ "//flutter:config" ]
deps = [
":flutter_windows_fixtures",
":flutter_windows_headers",
":flutter_windows_source",
"//flutter/shell/platform/common:common_cpp",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/platform/embedder:embedder_test_utils",
"//flutter/testing",
"//third_party/rapidjson",
]
}
shared_library("flutter_windows_glfw") {
deps = [ "//flutter/shell/platform/glfw:flutter_glfw" ]
public_configs = [ "//flutter:config" ]
}
group("windows_glfw") {
deps = [
":flutter_windows",
":flutter_windows_glfw",
"//flutter/shell/platform/glfw:publish_headers_glfw",
"//flutter/shell/platform/glfw/client_wrapper:publish_wrapper_glfw",
]
}
group("windows") {
deps = [
":flutter_windows",
":publish_headers_windows",
"//flutter/shell/platform/windows/client_wrapper:publish_wrapper_windows",
]
if (build_glfw_shell) {
deps += [ ":windows_glfw" ]
}
}