blob: 64377f444fc4e4da3310a5017d886d8c3bf81af7 [file] [log] [blame]
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//common-mk/generate-dbus-adaptors.gni")
import("//common-mk/pkg_config.gni")
group("all") {
deps = [
":cros-disks",
":libdisks",
":libdisks-adaptors",
]
if (use.fuzzer) {
deps += [
":cros-disks_filesystem_label_fuzzer",
":cros-disks_mount_options_fuzzer",
]
}
if (use.test) {
deps += [ ":disks_testrunner" ]
}
}
pkg_config("target_defaults") {
pkg_deps = [
"blkid",
"libbrillo",
"libchrome",
"libmetrics",
"libminijail",
"libsession_manager-client",
]
libs = [ "rootdev" ]
}
generate_dbus_adaptors("libdisks-adaptors") {
dbus_service_config = "dbus_bindings/dbus-service-config.json"
dbus_adaptors_out_dir = "include/cros-disks/dbus_adaptors"
sources = [ "dbus_bindings/org.chromium.CrosDisks.xml" ]
}
static_library("libdisks") {
sources = [
"archive_manager.cc",
"archive_mounter.cc",
"cros_disks_server.cc",
"daemon.cc",
"device_ejector.cc",
"device_event.cc",
"device_event_moderator.cc",
"device_event_queue.cc",
"disk.cc",
"disk_manager.cc",
"disk_monitor.cc",
"drivefs_helper.cc",
"drivefs_helper.h",
"error_logger.cc",
"file_reader.cc",
"filesystem_label.cc",
"format_manager.cc",
"fuse_mount_manager.cc",
"fuse_mounter.cc",
"metrics.cc",
"mount_info.cc",
"mount_manager.cc",
"mount_options.cc",
"mount_point.cc",
"partition_manager.cc",
"platform.cc",
"process.cc",
"quote.cc",
"rar_manager.cc",
"rename_manager.cc",
"sandboxed_init.cc",
"sandboxed_process.cc",
"session_manager_proxy.cc",
"smbfs_helper.cc",
"sshfs_helper.cc",
"system_mounter.cc",
"udev_device.cc",
"uri.cc",
"usb_device_info.cc",
"zip_manager.cc",
]
configs += [ ":target_defaults" ]
deps = [ ":libdisks-adaptors" ]
}
executable("cros-disks") {
sources = [ "main.cc" ]
configs += [ ":target_defaults" ]
deps = [ ":libdisks" ]
}
if (use.fuzzer) {
pkg_config("fuzzed_data_config") {
pkg_deps = [ "libchrome-test" ]
}
executable("cros-disks_mount_options_fuzzer") {
sources = [ "mount_options_fuzzer.cc" ]
configs += [
"//common-mk/common_fuzzer",
":fuzzed_data_config",
":target_defaults",
]
configs -= [ "//common-mk:no_exceptions" ]
deps = [ ":libdisks" ]
}
executable("cros-disks_filesystem_label_fuzzer") {
sources = [ "fuzzers/filesystem_label_fuzzer.cc" ]
configs += [
"//common-mk/common_fuzzer:common_fuzzer",
":target_defaults",
]
deps = [ ":libdisks" ]
}
}
if (use.test) {
pkg_config("disks_test_config") {
pkg_deps = [ "libchrome-test" ]
}
executable("disks_testrunner") {
sources = [
"archive_manager_test.cc",
"archive_mounter_test.cc",
"device_event_moderator_test.cc",
"device_event_queue_test.cc",
"disk_manager_test.cc",
"disk_monitor_test.cc",
"disk_test.cc",
"drivefs_helper_test.cc",
"error_logger_test.cc",
"file_reader_test.cc",
"filesystem_label_test.cc",
"format_manager_test.cc",
"fuse_mount_manager_test.cc",
"fuse_mounter_test.cc",
"metrics_test.cc",
"mount_info_test.cc",
"mount_manager_test.cc",
"mount_options_test.cc",
"mount_point_test.cc",
"platform_test.cc",
"process_test.cc",
"quote_test.cc",
"rar_manager_test.cc",
"rename_manager_test.cc",
"sandboxed_init_test.cc",
"smbfs_helper_test.cc",
"sshfs_helper_test.cc",
"system_mounter_test.cc",
"udev_device_test.cc",
"uri_test.cc",
"usb_device_info_test.cc",
"zip_manager_test.cc",
]
configs += [
"//common-mk:test",
":disks_test_config",
":target_defaults",
]
deps = [
":libdisks",
"//common-mk/testrunner",
]
}
}