BUILD.gn 5.2 KB
Newer Older
M
Michael Goderbauer 已提交
1
# Copyright 2013 The Flutter Authors. All rights reserved.
2 3 4 5
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

source_set("fml") {
6
  sources = [
7
    "arraysize.h",
8 9
    "base32.cc",
    "base32.h",
10
    "build_config.h",
11
    "closure.h",
12 13
    "command_line.cc",
    "command_line.h",
14 15
    "compiler_specific.h",
    "eintr_wrapper.h",
16
    "export.h",
17
    "file.cc",
18
    "file.h",
19 20
    "icu_util.cc",
    "icu_util.h",
21 22 23 24 25 26
    "log_level.h",
    "log_settings.cc",
    "log_settings.h",
    "log_settings_state.cc",
    "logging.cc",
    "logging.h",
27
    "make_copyable.h",
28
    "mapping.cc",
29
    "mapping.h",
30 31 32 33
    "memory/ref_counted.h",
    "memory/ref_counted_internal.h",
    "memory/ref_ptr.h",
    "memory/ref_ptr_internal.h",
34 35 36 37
    "memory/thread_checker.h",
    "memory/weak_ptr.h",
    "memory/weak_ptr_internal.cc",
    "memory/weak_ptr_internal.h",
38 39
    "message.cc",
    "message.h",
40 41 42 43
    "message_loop.cc",
    "message_loop.h",
    "message_loop_impl.cc",
    "message_loop_impl.h",
44 45
    "native_library.h",
    "paths.cc",
46
    "paths.h",
47 48
    "string_view.cc",
    "string_view.h",
49
    "synchronization/atomic_object.h",
50 51
    "synchronization/count_down_latch.cc",
    "synchronization/count_down_latch.h",
52
    "synchronization/shared_mutex.h",
53 54 55 56
    "synchronization/thread_annotations.h",
    "synchronization/thread_checker.h",
    "synchronization/waitable_event.cc",
    "synchronization/waitable_event.h",
57 58 59 60
    "task_runner.cc",
    "task_runner.h",
    "thread.cc",
    "thread.h",
61
    "thread_local.cc",
62
    "thread_local.h",
63 64 65
    "time/time_delta.h",
    "time/time_point.cc",
    "time/time_point.h",
66 67
    "trace_event.cc",
    "trace_event.h",
68 69 70
    "unique_fd.cc",
    "unique_fd.h",
    "unique_object.h",
71 72
  ]

73 74
  public_deps = []

75
  deps = [
76
    "//third_party/dart/runtime:dart_api",
77 78 79 80 81 82 83

    # These need to be in sync with the Fuchsia buildroot.
    "//third_party/icu",
  ]

  configs += [ "//third_party/icu:icu_config" ]

84
  public_configs = [ "$flutter_root:config" ]
85

86
  libs = []
87

88 89 90 91 92 93
  if (is_ios || is_mac) {
    sources += [ "platform/posix/shared_mutex_posix.cc" ]
  } else {
    sources += [ "synchronization/shared_mutex_std.cc" ]
  }

94
  if (is_ios || is_mac) {
95 96 97 98 99
    sources += [
      "platform/darwin/cf_utils.cc",
      "platform/darwin/cf_utils.h",
      "platform/darwin/message_loop_darwin.h",
      "platform/darwin/message_loop_darwin.mm",
100
      "platform/darwin/paths_darwin.mm",
101 102
      "platform/darwin/platform_version.h",
      "platform/darwin/platform_version.mm",
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
      "platform/darwin/scoped_block.h",
      "platform/darwin/scoped_block.mm",
      "platform/darwin/scoped_nsobject.h",
      "platform/darwin/scoped_nsobject.mm",
    ]

    libs += [ "Foundation.framework" ]
  }

  if (is_android) {
    sources += [
      "platform/android/jni_util.cc",
      "platform/android/jni_util.h",
      "platform/android/jni_weak_ref.cc",
      "platform/android/jni_weak_ref.h",
      "platform/android/message_loop_android.cc",
      "platform/android/message_loop_android.h",
120
      "platform/android/paths_android.cc",
121
      "platform/android/paths_android.h",
122 123 124 125 126
      "platform/android/scoped_java_ref.cc",
      "platform/android/scoped_java_ref.h",
    ]

    libs += [ "android" ]
127
  }
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142

  if (is_android) {
    # Don't filter away these Linux sources on Android.
    set_sources_assignment_filter([])
    sources += [
      "platform/linux/timerfd.cc",
      "platform/linux/timerfd.h",
    ]
    set_sources_assignment_filter(sources_assignment_filter)
  }

  if (is_linux) {
    sources += [
      "platform/linux/message_loop_linux.cc",
      "platform/linux/message_loop_linux.h",
143
      "platform/linux/paths_linux.cc",
144 145 146 147
      "platform/linux/timerfd.cc",
      "platform/linux/timerfd.h",
    ]
  }
148

149 150
  if (is_fuchsia) {
    sources += [ "platform/fuchsia/paths_fuchsia.cc" ]
151 152

    public_deps += [ "//zircon/public/lib/trace-provider" ]
153 154
  }

155 156
  if (is_win) {
    sources += [
157 158
      "platform/win/errors_win.cc",
      "platform/win/errors_win.h",
159
      "platform/win/file_win.cc",
160
      "platform/win/mapping_win.cc",
161 162
      "platform/win/message_loop_win.cc",
      "platform/win/message_loop_win.h",
163
      "platform/win/native_library_win.cc",
164
      "platform/win/paths_win.cc",
165
      "platform/win/wstring_conversion.h",
166
    ]
167 168
  } else {
    sources += [
169
      "platform/posix/file_posix.cc",
170
      "platform/posix/mapping_posix.cc",
171
      "platform/posix/native_library_posix.cc",
172
      "platform/posix/paths_posix.cc",
173
    ]
174
  }
175 176 177 178 179 180
}

executable("fml_unittests") {
  testonly = true

  sources = [
181
    "base32_unittest.cc",
182
    "command_line_unittest.cc",
183
    "file_unittest.cc",
184
    "memory/ref_counted_unittest.cc",
185
    "memory/weak_ptr_unittest.cc",
186
    "message_loop_unittests.cc",
187
    "message_unittests.cc",
188
    "paths_unittests.cc",
189
    "string_view_unittest.cc",
190
    "synchronization/count_down_latch_unittests.cc",
191 192 193
    "synchronization/thread_annotations_unittest.cc",
    "synchronization/thread_checker_unittest.cc",
    "synchronization/waitable_event_unittest.cc",
194 195
    "thread_local_unittests.cc",
    "thread_unittests.cc",
196 197 198
    "time/time_delta_unittest.cc",
    "time/time_point_unittest.cc",
    "time/time_unittest.cc",
199 200 201
  ]

  deps = [
202 203
    "$flutter_root/fml",
    "$flutter_root/testing",
204
    "//third_party/dart/runtime:libdart_jit",
205
  ]
206
}