| # Copyright 2021 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 = [ ":fusebox" ] |
| if (use.test) { |
| deps += [ ":fusebox_test" ] |
| } |
| } |
| |
| pkg_config("target_defaults") { |
| # NOSORT |
| pkg_deps = [ |
| "libbrillo", |
| "libchrome", |
| "libcap", |
| "fuse", |
| |
| # system_api depends on protobuf (or protobuf-lite). It must appear |
| # before protobuf here or the linker flags won't be in the right |
| # order. |
| "system_api", |
| "protobuf-lite", |
| ] |
| |
| # Define needed to configure <fuse_lowlevel.h>. |
| defines = [ "FUSE_USE_VERSION=26" ] |
| } |
| |
| generate_dbus_adaptors("fusebox-adaptors") { |
| dbus_service_config = "dbus_bindings/dbus-service-config.json" |
| dbus_adaptors_out_dir = "include/fusebox/dbus_adaptors" |
| sources = [ "dbus_bindings/org.chromium.FuseBoxClient.xml" ] |
| } |
| |
| static_library("libfusebox") { |
| sources = [ |
| "file_system.cc", |
| "file_system.h", |
| "file_system_fake.cc", |
| "file_system_fake.h", |
| "file_system_fuse.cc", |
| "fuse_file_handles.cc", |
| "fuse_file_handles.h", |
| "fuse_path_inodes.cc", |
| "fuse_path_inodes.h", |
| "fuse_request.cc", |
| "fuse_request.h", |
| "make_stat.cc", |
| "make_stat.h", |
| "util.cc", |
| "util.h", |
| ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| executable("fusebox") { |
| sources = [ |
| "fuse_frontend.h", |
| "main.cc", |
| ] |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":fusebox-adaptors", |
| ":libfusebox", |
| ] |
| } |
| |
| if (use.test) { |
| pkg_config("fusebox_test_config") { |
| pkg_deps = [ "libchrome-test" ] |
| } |
| |
| executable("fusebox_test") { |
| sources = [ |
| "fuse_file_handles_test.cc", |
| "fuse_path_inodes_test.cc", |
| "make_stat_test.cc", |
| "test_runner.cc", |
| "util_test.cc", |
| ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ":fusebox_test_config", |
| ] |
| deps = [ ":libfusebox" ] |
| } |
| } |