1# Copyright 2013 The Flutter Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import("$flutter_root/shell/platform/common/cpp/client_wrapper/publish.gni") 6import("$flutter_root/testing/testing.gni") 7 8_wrapper_includes = [ "include/flutter/flutter_window_controller.h" ] 9 10_wrapper_sources = [ "flutter_window_controller.cc" ] 11 12# This code will be merged into .../common/cpp/client_wrapper for client use, 13# so uses header paths that assume the merged state. Include the header 14# header directory of the core wrapper files so these includes will work. 15config("relative_core_wrapper_headers") { 16 include_dirs = [ 17 "$flutter_root/shell/platform/common/cpp/client_wrapper/include/flutter", 18 ] 19} 20 21# Windows client wrapper build for internal use by the shell implementation. 22source_set("client_wrapper_windows") { 23 sources = _wrapper_sources 24 public = _wrapper_includes 25 26 deps = [ 27 "$flutter_root/shell/platform/common/cpp:common_cpp_library_headers", 28 "$flutter_root/shell/platform/common/cpp/client_wrapper:client_wrapper", 29 "$flutter_root/shell/platform/windows:flutter_windows_headers", 30 ] 31 32 configs += [ 33 "$flutter_root/shell/platform/common/cpp:desktop_library_implementation", 34 ] 35 36 public_configs = [ 37 ":relative_core_wrapper_headers", 38 "$flutter_root/shell/platform/common/cpp:relative_flutter_library_headers", 39 "$flutter_root/shell/platform/windows:relative_flutter_windows_headers", 40 ] 41} 42 43# Copies the Windows client wrapper code to the output directory with a _windows 44# suffix. 45publish_client_wrapper_extension("publish_wrapper_windows") { 46 public = _wrapper_includes 47 sources = _wrapper_sources 48 directory_suffix = "windows" 49} 50 51source_set("client_wrapper_library_stubs_windows") { 52 sources = [ 53 "testing/stub_flutter_windows_api.cc", 54 "testing/stub_flutter_windows_api.h", 55 ] 56 57 defines = [ "FLUTTER_DESKTOP_LIBRARY" ] 58 59 public_deps = 60 [ "$flutter_root/shell/platform/windows:flutter_windows_headers" ] 61} 62 63test_fixtures("client_wrapper_windows_fixtures") { 64 fixtures = [] 65} 66 67executable("client_wrapper_windows_unittests") { 68 testonly = true 69 70 # TODO: Add more unit tests. 71 sources = [ "flutter_window_controller_unittests.cc" ] 72 73 deps = [ 74 ":client_wrapper_library_stubs_windows", 75 ":client_wrapper_windows", 76 ":client_wrapper_windows_fixtures", 77 "$flutter_root/shell/platform/common/cpp/client_wrapper:client_wrapper_library_stubs", 78 "$flutter_root/testing", 79 80 # TODO: Consider refactoring flutter_root/testing so that there's a testing 81 # target that doesn't require a Dart runtime to be linked in. 82 "//third_party/dart/runtime:libdart_jit", 83 ] 84} 85