| # 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/pkg_config.gni") |
| |
| group("all") { |
| deps = [ |
| ":libcrossystem_utils", |
| ":libdbus_service", |
| ":libjson_store", |
| ":librmad_interface", |
| ":libstate_handler", |
| ":libvpd_utils", |
| ":rmad", |
| ] |
| if (use.test) { |
| deps += [ ":rmad_test" ] |
| } |
| } |
| |
| pkg_config("target_defaults") { |
| # NOSORT |
| pkg_deps = [ |
| "libbrillo", |
| "libchrome", |
| "vboot_host", |
| |
| # 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", |
| ] |
| } |
| |
| static_library("libjson_store") { |
| sources = [ "utils/json_store.cc" ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| static_library("libcrossystem_utils") { |
| sources = [ |
| "utils/crossystem_utils.cc", |
| "utils/crossystem_utils_impl.cc", |
| ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| static_library("libvpd_utils") { |
| sources = [ "utils/vpd_utils_impl.cc" ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| static_library("libcr50_utils") { |
| sources = [ "utils/cr50_utils_impl.cc" ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| static_library("libstate_handler") { |
| sources = [ |
| "state_handler/base_state_handler.cc", |
| "state_handler/calibrate_components_state_handler.cc", |
| "state_handler/components_repair_state_handler.cc", |
| "state_handler/device_destination_state_handler.cc", |
| "state_handler/finalize_state_handler.cc", |
| "state_handler/provision_device_state_handler.cc", |
| "state_handler/restock_state_handler.cc", |
| "state_handler/select_network_state_handler.cc", |
| "state_handler/state_handler_manager.cc", |
| "state_handler/update_chrome_state_handler.cc", |
| "state_handler/update_device_info_state_handler.cc", |
| "state_handler/update_ro_firmware_state_handler.cc", |
| "state_handler/welcome_screen_state_handler.cc", |
| "state_handler/write_protect_disable_complete_state_handler.cc", |
| "state_handler/write_protect_disable_method_state_handler.cc", |
| "state_handler/write_protect_disable_physical_state_handler.cc", |
| "state_handler/write_protect_disable_rsu_state_handler.cc", |
| "state_handler/write_protect_enable_physical_state_handler.cc", |
| ] |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":libcr50_utils", |
| ":libjson_store", |
| ] |
| } |
| |
| static_library("libdbus_service") { |
| sources = [ "dbus_service.cc" ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| static_library("librmad_interface") { |
| sources = [ "rmad_interface_impl.cc" ] |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":libcr50_utils", |
| ":libjson_store", |
| ":libstate_handler", |
| ] |
| } |
| |
| executable("rmad") { |
| sources = [ "main.cc" ] |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":libdbus_service", |
| ":librmad_interface", |
| ] |
| } |
| |
| if (use.test) { |
| executable("rmad_test") { |
| sources = [ |
| "dbus_service_test.cc", |
| "rmad_interface_test.cc", |
| "state_handler/state_handler_manager_test.cc", |
| "utils/fake_crossystem_utils.cc", |
| "utils/fake_vpd_utils.cc", |
| "utils/json_store_test.cc", |
| ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ] |
| deps = [ |
| ":libdbus_service", |
| ":libjson_store", |
| ":librmad_interface", |
| ":libstate_handler", |
| "//common-mk/testrunner", |
| ] |
| } |
| } |