| # 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/pkg_config.gni") |
| |
| group("all") { |
| deps = [ |
| ":chromeos_startup", |
| ":clobber-state", |
| ":cros_sysrq_init", |
| ":file_attrs_cleaner_tool", |
| ":net_poll_tool", |
| ":periodic_scheduler", |
| ":process_killer", |
| ":static_node_tool", |
| ":usermode-helper", |
| ] |
| if (use.test) { |
| deps += [ |
| ":clobber_state_test", |
| ":file_attrs_cleaner_test", |
| ":periodic_scheduler_test", |
| ":process_killer_test", |
| ":usermode-helper_test", |
| ":utils_test", |
| ] |
| } |
| } |
| |
| pkg_config("target_defaults") { |
| defines = [ |
| "USE_LVM_STATEFUL_PARTITION=${use.lvm_stateful_partition}", |
| "USE_DIRENCRYPTION=${use.direncryption}", |
| "USE_ENCRYPTED_REBOOT_VAULT=${use.encrypted_reboot_vault}", |
| "USE_ENCRYPTED_STATEFUL=${use.encrypted_stateful}", |
| "USE_TPM2=${use.tpm2}", |
| "USE_FSVERITY=${use.fsverity}", |
| "USE_PRJQUOTA=${use.prjquota}", |
| ] |
| pkg_deps = [ |
| "libbrillo", |
| "libchrome", |
| "libcrypto", |
| "libmetrics", |
| "re2", |
| "vboot_host", |
| ] |
| libs = [ |
| "bootstat", |
| "rootdev", |
| "secure_erase_file", |
| ] |
| } |
| |
| static_library("libcrossystem") { |
| sources = [ |
| "crossystem.cc", |
| "crossystem_fake.cc", |
| "crossystem_impl.cc", |
| ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| static_library("utils") { |
| sources = [ "utils.cc" ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| static_library("libcrosstartup") { |
| sources = [ "startup/chromeos_startup.cc" ] |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":libclobber", |
| ":libcrossystem", |
| ] |
| } |
| |
| static_library("libclobber") { |
| sources = [ |
| "clobber_state.cc", |
| "clobber_ui.cc", |
| ] |
| configs += [ ":target_defaults" ] |
| deps = [ ":utils" ] |
| } |
| |
| executable("chromeos_startup") { |
| sources = [ "startup/main.cc" ] |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":libclobber", |
| ":libcrosstartup", |
| ":libcrossystem", |
| ] |
| } |
| |
| executable("clobber-state") { |
| sources = [ "clobber_state_main.cc" ] |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":libclobber", |
| ":libcrossystem", |
| ":utils", |
| ] |
| } |
| |
| static_library("file_attrs_cleaner_lib") { |
| sources = [ "file_attrs_cleaner_lib.cc" ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| executable("file_attrs_cleaner_tool") { |
| sources = [ "file_attrs_cleaner_tool.cc" ] |
| configs += [ ":target_defaults" ] |
| deps = [ ":file_attrs_cleaner_lib" ] |
| } |
| |
| static_library("process_killer_lib") { |
| sources = [ |
| "process_killer/process.cc", |
| "process_killer/process_killer.cc", |
| "process_killer/process_manager.cc", |
| ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| executable("process_killer") { |
| sources = [ "process_killer/main.cc" ] |
| configs += [ ":target_defaults" ] |
| deps = [ ":process_killer_lib" ] |
| } |
| |
| executable("periodic_scheduler") { |
| sources = [ |
| "periodic_scheduler.cc", |
| "periodic_scheduler_main.cc", |
| ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| executable("cros_sysrq_init") { |
| sources = [ "cros_sysrq_init.cc" ] |
| pkg_deps = [ "vboot_host" ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| executable("net_poll_tool") { |
| sources = [ "net_poll_tool.cc" ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| executable("static_node_tool") { |
| sources = [ "static_node_tool.cc" ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| static_library("usermode-helper_lib") { |
| sources = [ "usermode-helper_lib.cc" ] |
| configs += [ ":target_defaults" ] |
| } |
| |
| executable("usermode-helper") { |
| sources = [ "usermode-helper.cc" ] |
| configs += [ ":target_defaults" ] |
| deps = [ ":usermode-helper_lib" ] |
| } |
| |
| if (use.test) { |
| pkg_config("test_config") { |
| pkg_deps = [ "libchrome-test" ] |
| } |
| |
| executable("clobber_state_test") { |
| sources = [ |
| "clobber_state_test.cc", |
| "clobber_ui_test.cc", |
| ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ":test_config", |
| ] |
| deps = [ |
| ":libclobber", |
| ":libcrossystem", |
| ":utils", |
| "//common-mk/testrunner", |
| ] |
| } |
| |
| executable("file_attrs_cleaner_test") { |
| sources = [ "file_attrs_cleaner_test.cc" ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ":test_config", |
| ] |
| deps = [ |
| ":file_attrs_cleaner_lib", |
| "//common-mk/testrunner", |
| ] |
| } |
| |
| executable("process_killer_test") { |
| sources = [ |
| "process_killer/process_killer_test.cc", |
| "process_killer/process_manager_test.cc", |
| "process_killer/process_test.cc", |
| ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ":test_config", |
| ] |
| deps = [ |
| ":process_killer_lib", |
| "//common-mk/testrunner", |
| ] |
| } |
| |
| executable("periodic_scheduler_test") { |
| sources = [ |
| "periodic_scheduler.cc", |
| "periodic_scheduler_test.cc", |
| ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ":test_config", |
| ] |
| deps = [ "//common-mk/testrunner" ] |
| } |
| |
| executable("usermode-helper_test") { |
| sources = [ "usermode-helper_test.cc" ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ":test_config", |
| ] |
| deps = [ |
| ":usermode-helper_lib", |
| "//common-mk/testrunner", |
| ] |
| } |
| |
| executable("utils_test") { |
| sources = [ "utils_test.cc" ] |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ":test_config", |
| ] |
| deps = [ |
| ":utils", |
| "//common-mk/testrunner", |
| ] |
| } |
| } |