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("//build/fuchsia/sdk.gni") 6import("$flutter_root/testing/testing.gni") 7 8source_set("fml") { 9 sources = [ 10 "base32.cc", 11 "base32.h", 12 "build_config.h", 13 "closure.h", 14 "command_line.cc", 15 "command_line.h", 16 "compiler_specific.h", 17 "concurrent_message_loop.cc", 18 "concurrent_message_loop.h", 19 "delayed_task.cc", 20 "delayed_task.h", 21 "eintr_wrapper.h", 22 "file.cc", 23 "file.h", 24 "gpu_thread_merger.cc", 25 "gpu_thread_merger.h", 26 "icu_util.cc", 27 "icu_util.h", 28 "log_level.h", 29 "log_settings.cc", 30 "log_settings.h", 31 "log_settings_state.cc", 32 "logging.cc", 33 "logging.h", 34 "make_copyable.h", 35 "mapping.cc", 36 "mapping.h", 37 "memory/ref_counted.h", 38 "memory/ref_counted_internal.h", 39 "memory/ref_ptr.h", 40 "memory/ref_ptr_internal.h", 41 "memory/thread_checker.h", 42 "memory/weak_ptr.h", 43 "memory/weak_ptr_internal.cc", 44 "memory/weak_ptr_internal.h", 45 "message.cc", 46 "message.h", 47 "message_loop.cc", 48 "message_loop.h", 49 "message_loop_impl.cc", 50 "message_loop_impl.h", 51 "message_loop_task_queues.cc", 52 "message_loop_task_queues.h", 53 "native_library.h", 54 "paths.cc", 55 "paths.h", 56 "size.h", 57 "synchronization/atomic_object.h", 58 "synchronization/count_down_latch.cc", 59 "synchronization/count_down_latch.h", 60 "synchronization/semaphore.cc", 61 "synchronization/semaphore.h", 62 "synchronization/shared_mutex.h", 63 "synchronization/thread_annotations.h", 64 "synchronization/waitable_event.cc", 65 "synchronization/waitable_event.h", 66 "task_runner.cc", 67 "task_runner.h", 68 "thread.cc", 69 "thread.h", 70 "thread_local.cc", 71 "thread_local.h", 72 "time/time_delta.h", 73 "time/time_point.cc", 74 "time/time_point.h", 75 "trace_event.cc", 76 "trace_event.h", 77 "unique_fd.cc", 78 "unique_fd.h", 79 "unique_object.h", 80 "wakeable.h", 81 ] 82 83 public_deps = [] 84 85 deps = [ 86 "//third_party/dart/runtime:dart_api", 87 88 # These need to be in sync with the Fuchsia buildroot. 89 "//third_party/icu", 90 ] 91 92 configs += [ "//third_party/icu:icu_config" ] 93 94 public_configs = [ 95 "$flutter_root:config", 96 "$flutter_root/common:flutter_config", 97 ] 98 99 libs = [] 100 101 if (is_ios || is_mac) { 102 sources += [ "platform/posix/shared_mutex_posix.cc" ] 103 } else { 104 sources += [ "synchronization/shared_mutex_std.cc" ] 105 } 106 107 if (is_ios || is_mac) { 108 sources += [ 109 "platform/darwin/cf_utils.cc", 110 "platform/darwin/cf_utils.h", 111 "platform/darwin/message_loop_darwin.h", 112 "platform/darwin/message_loop_darwin.mm", 113 "platform/darwin/paths_darwin.mm", 114 "platform/darwin/platform_version.h", 115 "platform/darwin/platform_version.mm", 116 "platform/darwin/scoped_block.h", 117 "platform/darwin/scoped_block.mm", 118 "platform/darwin/scoped_nsobject.h", 119 "platform/darwin/scoped_nsobject.mm", 120 "platform/darwin/string_range_sanitization.h", 121 "platform/darwin/string_range_sanitization.mm", 122 ] 123 124 libs += [ "Foundation.framework" ] 125 } 126 127 if (is_android) { 128 sources += [ 129 "platform/android/jni_util.cc", 130 "platform/android/jni_util.h", 131 "platform/android/jni_weak_ref.cc", 132 "platform/android/jni_weak_ref.h", 133 "platform/android/message_loop_android.cc", 134 "platform/android/message_loop_android.h", 135 "platform/android/paths_android.cc", 136 "platform/android/paths_android.h", 137 "platform/android/scoped_java_ref.cc", 138 "platform/android/scoped_java_ref.h", 139 ] 140 141 libs += [ "android" ] 142 } 143 144 if (is_android) { 145 sources += [ 146 "platform/linux/timerfd.cc", 147 "platform/linux/timerfd.h", 148 ] 149 } 150 151 if (is_linux) { 152 sources += [ 153 "platform/linux/message_loop_linux.cc", 154 "platform/linux/message_loop_linux.h", 155 "platform/linux/paths_linux.cc", 156 "platform/linux/timerfd.cc", 157 "platform/linux/timerfd.h", 158 ] 159 } 160 161 if (is_fuchsia) { 162 sources += [ "platform/fuchsia/paths_fuchsia.cc" ] 163 164 if (using_fuchsia_sdk) { 165 public_deps += [ "$fuchsia_sdk_root/pkg:trace" ] 166 } else { 167 public_deps += [ "//zircon/public/lib/trace" ] 168 } 169 } 170 171 if (is_win) { 172 sources += [ 173 "platform/win/errors_win.cc", 174 "platform/win/errors_win.h", 175 "platform/win/file_win.cc", 176 "platform/win/mapping_win.cc", 177 "platform/win/message_loop_win.cc", 178 "platform/win/message_loop_win.h", 179 "platform/win/native_library_win.cc", 180 "platform/win/paths_win.cc", 181 "platform/win/wstring_conversion.h", 182 ] 183 } else { 184 sources += [ 185 "platform/posix/file_posix.cc", 186 "platform/posix/mapping_posix.cc", 187 "platform/posix/native_library_posix.cc", 188 "platform/posix/paths_posix.cc", 189 ] 190 } 191} 192 193test_fixtures("fml_fixtures") { 194 fixtures = [] 195} 196 197executable("fml_unittests") { 198 testonly = true 199 200 sources = [ 201 "base32_unittest.cc", 202 "command_line_unittest.cc", 203 "file_unittest.cc", 204 "gpu_thread_merger_unittests.cc", 205 "memory/ref_counted_unittest.cc", 206 "memory/weak_ptr_unittest.cc", 207 "message_loop_task_queues_merge_unmerge_unittests.cc", 208 "message_loop_task_queues_unittests.cc", 209 "message_loop_unittests.cc", 210 "message_unittests.cc", 211 "paths_unittests.cc", 212 "platform/darwin/string_range_sanitization_unittests.mm", 213 "synchronization/count_down_latch_unittests.cc", 214 "synchronization/semaphore_unittest.cc", 215 "synchronization/thread_annotations_unittest.cc", 216 "synchronization/waitable_event_unittest.cc", 217 "thread_local_unittests.cc", 218 "thread_unittests.cc", 219 "time/time_delta_unittest.cc", 220 "time/time_point_unittest.cc", 221 "time/time_unittest.cc", 222 ] 223 224 deps = [ 225 ":fml_fixtures", 226 "$flutter_root/fml", 227 "$flutter_root/testing", 228 "//third_party/dart/runtime:libdart_jit", 229 ] 230} 231 232executable("fml_benchmarks") { 233 testonly = true 234 235 sources = [ "message_loop_task_queues_benchmark.cc" ] 236 237 deps = [ 238 "$flutter_root/benchmarking", 239 "$flutter_root/fml", 240 "$flutter_root/runtime:libdart", 241 ] 242} 243