BUILD.gn 4.5 KB
Newer Older
1 2 3 4 5 6 7 8 9
# Copyright 2016 The Chromium 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_ios)

import("//build/config/ios/rules.gni")
import("//build/config/ios/ios_sdk.gni")

10 11
_flutter_framework_dir = "$root_out_dir/Flutter.framework"

12 13 14 15 16 17 18 19 20 21
shared_library("flutter_framework_dylib") {
  visibility = [ ":*" ]

  output_name = "Flutter"

  sources = [
    "framework/Headers/Flutter.h",
    "framework/Headers/FlutterAppDelegate.h",
    "framework/Headers/FlutterAsyncMessageListener.h",
    "framework/Headers/FlutterDartProject.h",
22
    "framework/Headers/FlutterJSONMessageListener.h",
23 24 25 26 27 28 29 30 31 32 33 34 35 36
    "framework/Headers/FlutterMacros.h",
    "framework/Headers/FlutterMessageListener.h",
    "framework/Headers/FlutterViewController.h",
    "framework/Source/accessibility_bridge.h",
    "framework/Source/accessibility_bridge.mm",
    "framework/Source/application_messages_impl.h",
    "framework/Source/application_messages_impl.mm",
    "framework/Source/flutter_touch_mapper.h",
    "framework/Source/flutter_touch_mapper.mm",
    "framework/Source/FlutterAppDelegate.mm",
    "framework/Source/FlutterDartProject.mm",
    "framework/Source/FlutterDartProject_Internal.h",
    "framework/Source/FlutterDartSource.h",
    "framework/Source/FlutterDartSource.mm",
37 38 39
    "framework/Source/FlutterJSONMessageListener.mm",
    "framework/Source/FlutterPlatformPlugin.h",
    "framework/Source/FlutterPlatformPlugin.mm",
40 41 42
    "framework/Source/FlutterTextInputDelegate.h",
    "framework/Source/FlutterTextInputPlugin.h",
    "framework/Source/FlutterTextInputPlugin.mm",
43 44 45 46 47 48
    "framework/Source/FlutterView.h",
    "framework/Source/FlutterView.mm",
    "framework/Source/FlutterViewController.mm",
    "platform_view_ios.h",
    "platform_view_ios.mm",
  ]
49

50 51 52 53

  deps = [
    "//base:base",
    "//dart/runtime:libdart",
54
    "//flutter/lib/ui",
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
    "//flutter/services/engine:interfaces",
    "//flutter/services/platform",
    "//flutter/services/vsync",
    "//flutter/shell/common",
    "//flutter/shell/gpu",
    "//flutter/shell/platform/darwin/common",
    "//flutter/skia",
    "//flutter/sky/engine/platform",
    "//flutter/sky/engine/wtf",
    "//lib/ftl",
    "//mojo/edk/base_edk",
    "//mojo/edk/system",
    "//mojo/public/cpp/application",
    "//mojo/public/cpp/bindings",
    "//mojo/public/interfaces/application",
  ]

  defines = [
    "FLUTTER_FRAMEWORK"
  ]

  libs = [
    "UIKit.framework",
    "OpenGLES.framework",
    "AVFoundation.framework",
    "AudioToolbox.framework",
    "QuartzCore.framework",
  ]
}

85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
copy("framework_dylib") {
  visibility = [ ":*" ]
  sources = [ "$root_out_dir/libFlutter.dylib" ]
  outputs = [ "$_flutter_framework_dir/Flutter" ]

  deps = [
    ":flutter_framework_dylib",
  ]
}

action("framework_install_name") {
  visibility = [ ":*" ]
  stamp_file = "$root_out_dir/flutter_install_name_stamp"
  script = "//flutter/sky/tools/change_install_name.py"

  inputs = [ "$_flutter_framework_dir/Flutter" ]
  outputs = [ stamp_file ]

  args = [
    "--dylib",
    rebase_path("$_flutter_framework_dir/Flutter"),
    "--install_name",
    "@rpath/Flutter.framework/Flutter",
    "--stamp",
    rebase_path(stamp_file),
  ]

  deps = [
    ":framework_dylib"
  ]
}

copy("framework_info_plist") {
  visibility = [ ":*" ]
  sources = [ "framework/Info.plist" ]
  outputs = [ "$_flutter_framework_dir/Info.plist" ]
}

copy("framework_module_map") {
  visibility = [ ":*" ]
  sources = [ "framework/module.modulemap" ]
  outputs = [ "$_flutter_framework_dir/Modules/module.modulemap" ]
}
128

129 130 131 132 133 134 135
copy("framework_headers") {
  visibility = [ ":*" ]
  sources = [
    "framework/Headers/Flutter.h",
    "framework/Headers/FlutterAppDelegate.h",
    "framework/Headers/FlutterAsyncMessageListener.h",
    "framework/Headers/FlutterDartProject.h",
136
    "framework/Headers/FlutterJSONMessageListener.h",
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
    "framework/Headers/FlutterMacros.h",
    "framework/Headers/FlutterMessageListener.h",
    "framework/Headers/FlutterViewController.h",
  ]
  outputs = [ "$_flutter_framework_dir/Headers/{{source_file_part}}" ]
}

copy("framework_icu") {
  visibility = [ ":*" ]
  set_sources_assignment_filter([])
  sources = [
    "//third_party/icu/android/icudtl.dat",
  ]
  set_sources_assignment_filter(sources_assignment_filter)
  outputs = [ "$_flutter_framework_dir/{{source_file_part}}" ]
}

group("flutter_framework") {
155 156 157 158 159 160 161 162 163
  public_deps = [
    ":framework_dylib",
    ":framework_headers",
    ":framework_icu",
    ":framework_info_plist",
    ":framework_install_name",
    ":framework_module_map",
  ]
}