blob: 9b5626e787b1cc90b8291c06c85a0a82689176b2 [file] [log] [blame]
# Copyright 2013 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
if (is_fuchsia) {
import("//build/fuchsia/sdk.gni")
import("//flutter/tools/fuchsia/fuchsia_archive.gni")
}
import("//flutter/testing/testing.gni")
source_set("fml") {
sources = [
"ascii_trie.cc",
"ascii_trie.h",
"backtrace.h",
"base32.cc",
"base32.h",
"build_config.h",
"closure.h",
"command_line.cc",
"command_line.h",
"compiler_specific.h",
"concurrent_message_loop.cc",
"concurrent_message_loop.h",
"delayed_task.cc",
"delayed_task.h",
"eintr_wrapper.h",
"file.cc",
"file.h",
"hash_combine.h",
"icu_util.cc",
"icu_util.h",
"log_level.h",
"log_settings.cc",
"log_settings.h",
"log_settings_state.cc",
"logging.cc",
"logging.h",
"make_copyable.h",
"mapping.cc",
"mapping.h",
"memory/ref_counted.h",
"memory/ref_counted_internal.h",
"memory/ref_ptr.h",
"memory/ref_ptr_internal.h",
"memory/thread_checker.h",
"memory/weak_ptr.h",
"memory/weak_ptr_internal.cc",
"memory/weak_ptr_internal.h",
"message.cc",
"message.h",
"message_loop.cc",
"message_loop.h",
"message_loop_impl.cc",
"message_loop_impl.h",
"message_loop_task_queues.cc",
"message_loop_task_queues.h",
"native_library.h",
"paths.cc",
"paths.h",
"posix_wrappers.h",
"raster_thread_merger.cc",
"raster_thread_merger.h",
"size.h",
"synchronization/atomic_object.h",
"synchronization/count_down_latch.cc",
"synchronization/count_down_latch.h",
"synchronization/semaphore.cc",
"synchronization/semaphore.h",
"synchronization/shared_mutex.h",
"synchronization/sync_switch.cc",
"synchronization/sync_switch.h",
"synchronization/waitable_event.cc",
"synchronization/waitable_event.h",
"task_runner.cc",
"task_runner.h",
"thread.cc",
"thread.h",
"thread_local.cc",
"thread_local.h",
"time/time_delta.h",
"time/time_point.cc",
"time/time_point.h",
"trace_event.cc",
"trace_event.h",
"unique_fd.cc",
"unique_fd.h",
"unique_object.h",
"wakeable.h",
]
if (is_mac || is_ios || is_linux) {
sources += [ "backtrace.cc" ]
} else {
sources += [ "backtrace_stub.cc" ]
}
public_deps = []
deps = [
"//third_party/dart/runtime:dart_api",
# These need to be in sync with the Fuchsia buildroot.
"//third_party/icu",
]
configs += [ "//third_party/icu:icu_config" ]
public_configs = [
"//flutter:config",
"//flutter/common:flutter_config",
]
libs = []
if (is_ios || is_mac) {
sources += [ "platform/posix/shared_mutex_posix.cc" ]
} else {
sources += [ "synchronization/shared_mutex_std.cc" ]
}
if (is_ios || is_mac) {
sources += [
"platform/darwin/cf_utils.cc",
"platform/darwin/cf_utils.h",
"platform/darwin/message_loop_darwin.h",
"platform/darwin/message_loop_darwin.mm",
"platform/darwin/paths_darwin.mm",
"platform/darwin/platform_version.h",
"platform/darwin/platform_version.mm",
"platform/darwin/scoped_block.h",
"platform/darwin/scoped_block.mm",
"platform/darwin/scoped_nsobject.h",
"platform/darwin/scoped_nsobject.mm",
"platform/darwin/string_range_sanitization.h",
"platform/darwin/string_range_sanitization.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",
"platform/android/paths_android.cc",
"platform/android/paths_android.h",
"platform/android/scoped_java_ref.cc",
"platform/android/scoped_java_ref.h",
]
libs += [ "android" ]
}
if (is_android) {
sources += [
"platform/linux/timerfd.cc",
"platform/linux/timerfd.h",
]
}
if (is_linux) {
sources += [
"platform/linux/message_loop_linux.cc",
"platform/linux/message_loop_linux.h",
"platform/linux/paths_linux.cc",
"platform/linux/timerfd.cc",
"platform/linux/timerfd.h",
]
}
if (is_fuchsia) {
sources += [
"platform/fuchsia/message_loop_fuchsia.cc",
"platform/fuchsia/message_loop_fuchsia.h",
"platform/fuchsia/paths_fuchsia.cc",
]
public_deps += [
"$fuchsia_sdk_root/pkg:async-cpp",
"$fuchsia_sdk_root/pkg:async-loop-cpp",
"$fuchsia_sdk_root/pkg:async-loop-default",
"$fuchsia_sdk_root/pkg:trace",
"$fuchsia_sdk_root/pkg:trace-engine",
"$fuchsia_sdk_root/pkg:zx",
]
}
if (is_win) {
sources += [
"platform/win/errors_win.cc",
"platform/win/errors_win.h",
"platform/win/file_win.cc",
"platform/win/mapping_win.cc",
"platform/win/message_loop_win.cc",
"platform/win/message_loop_win.h",
"platform/win/native_library_win.cc",
"platform/win/paths_win.cc",
"platform/win/posix_wrappers_win.cc",
"platform/win/wstring_conversion.h",
]
if (is_win) {
# For wstring_conversion. See issue #50053.
defines = [ "_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING" ]
}
} else {
sources += [
"platform/posix/file_posix.cc",
"platform/posix/mapping_posix.cc",
"platform/posix/native_library_posix.cc",
"platform/posix/paths_posix.cc",
"platform/posix/posix_wrappers_posix.cc",
]
}
}
test_fixtures("fml_fixtures") {
fixtures = []
}
executable("fml_unittests") {
testonly = true
sources = [
"ascii_trie_unittests.cc",
"backtrace_unittests.cc",
"base32_unittest.cc",
"command_line_unittest.cc",
"file_unittest.cc",
"hash_combine_unittests.cc",
"memory/ref_counted_unittest.cc",
"memory/weak_ptr_unittest.cc",
"message_loop_task_queues_merge_unmerge_unittests.cc",
"message_loop_task_queues_unittests.cc",
"message_loop_unittests.cc",
"message_unittests.cc",
"paths_unittests.cc",
"raster_thread_merger_unittests.cc",
"synchronization/count_down_latch_unittests.cc",
"synchronization/semaphore_unittest.cc",
"synchronization/sync_switch_unittest.cc",
"synchronization/waitable_event_unittest.cc",
"thread_local_unittests.cc",
"thread_unittests.cc",
"time/time_delta_unittest.cc",
"time/time_point_unittest.cc",
"time/time_unittest.cc",
]
if (is_mac) {
sources += [
"platform/darwin/cf_utils_unittests.mm",
"platform/darwin/string_range_sanitization_unittests.mm",
]
}
deps = [
":fml_fixtures",
"//flutter/fml",
"//flutter/fml/dart",
"//flutter/runtime:libdart",
"//flutter/testing",
]
if (is_fuchsia) {
libs = [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ]
}
}
if (is_fuchsia) {
fuchsia_test_archive("fml_tests") {
deps = [
":fml_unittests",
]
binary = "fml_unittests"
}
}
executable("fml_benchmarks") {
testonly = true
sources = [
"message_loop_task_queues_benchmark.cc",
]
deps = [
"//flutter/benchmarking",
"//flutter/fml",
"//flutter/runtime:libdart",
]
}