BUILD.gn 4.6 KB
Newer Older
1 2 3 4 5
# Copyright 2017 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.

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

65 66
  public_deps = []

67
  deps = [
68
    "//third_party/dart/runtime:dart_api",
69 70 71 72 73 74 75

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

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

76
  public_configs = [ "$flutter_root:config" ]
77

78
  libs = []
79 80

  if (is_ios || is_mac) {
81 82 83 84 85
    sources += [
      "platform/darwin/cf_utils.cc",
      "platform/darwin/cf_utils.h",
      "platform/darwin/message_loop_darwin.h",
      "platform/darwin/message_loop_darwin.mm",
86
      "platform/darwin/paths_darwin.mm",
87 88
      "platform/darwin/platform_version.h",
      "platform/darwin/platform_version.mm",
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
      "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",
106
      "platform/android/paths_android.cc",
107 108 109 110 111
      "platform/android/scoped_java_ref.cc",
      "platform/android/scoped_java_ref.h",
    ]

    libs += [ "android" ]
112
  }
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127

  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",
128
      "platform/linux/paths_linux.cc",
129 130 131 132
      "platform/linux/timerfd.cc",
      "platform/linux/timerfd.h",
    ]
  }
133

134 135
  if (is_fuchsia) {
    sources += [ "platform/fuchsia/paths_fuchsia.cc" ]
136 137

    public_deps += [ "//zircon/public/lib/trace-provider" ]
138 139
  }

140 141
  if (is_win) {
    sources += [
142
      "platform/win/file_win.cc",
143
      "platform/win/mapping_win.cc",
144 145
      "platform/win/message_loop_win.cc",
      "platform/win/message_loop_win.h",
146
      "platform/win/native_library_win.cc",
147
      "platform/win/paths_win.cc",
148
      "platform/win/wstring_conversion.h",
149
    ]
150 151
  } else {
    sources += [
152
      "platform/posix/file_posix.cc",
153
      "platform/posix/mapping_posix.cc",
154
      "platform/posix/native_library_posix.cc",
155
      "platform/posix/paths_posix.cc",
156
    ]
157
  }
158 159 160 161 162 163
}

executable("fml_unittests") {
  testonly = true

  sources = [
164
    "command_line_unittest.cc",
165
    "memory/ref_counted_unittest.cc",
166
    "memory/weak_ptr_unittest.cc",
167
    "message_loop_unittests.cc",
168
    "message_unittests.cc",
169
    "string_view_unittest.cc",
170 171 172
    "synchronization/thread_annotations_unittest.cc",
    "synchronization/thread_checker_unittest.cc",
    "synchronization/waitable_event_unittest.cc",
173 174
    "thread_local_unittests.cc",
    "thread_unittests.cc",
175 176 177
    "time/time_delta_unittest.cc",
    "time/time_point_unittest.cc",
    "time/time_unittest.cc",
178 179 180
  ]

  deps = [
181 182
    "$flutter_root/fml",
    "$flutter_root/testing",
183
    "//third_party/dart/runtime:libdart_jit",
184
  ]
185
}