blob: 82c762a5478e2dc73c64da7a0df721da7bd98fbe [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/pkg_config.gni")
group("all") {
deps = [ ":cros_installer" ]
if (!use.cros_host) {
deps += [
":cros_oobe_crypto",
":evwaitkey",
":key_reader",
]
}
if (use.mtd) {
deps += [ ":nand_partition" ]
}
if (use.test) {
deps += [ ":cros_installer_test" ]
}
}
pkg_config("target_defaults") {
pkg_deps = [
"libbrillo",
"libchrome",
"vboot_host",
]
include_dirs = [ "${sysroot}/usr/include/verity" ]
libs = [ "dm-bht" ]
}
static_library("libcros_installer") {
configs += [ ":target_defaults" ]
sources = [
"cgpt_manager.cc",
"chromeos_install_config.cc",
"chromeos_legacy.cc",
"chromeos_postinst.cc",
"chromeos_setimage.cc",
"chromeos_verity.cc",
"inst_util.cc",
]
if (use.enable_slow_boot_notify) {
sources += [ "slow_boot_notify_enable.cc" ]
} else {
sources += [ "slow_boot_notify_stub.cc" ]
}
}
pkg_config("cros_installer_config") {
pkg_deps = [ "libchrome" ]
}
executable("cros_installer") {
configs += [
":cros_installer_config",
":target_defaults",
]
deps = [ ":libcros_installer" ]
sources = [ "cros_installer_main.cc" ]
}
executable("evwaitkey") {
configs += [ ":target_defaults" ]
sources = [ "util/evwaitkey.c" ]
}
static_library("libkey_reader") {
configs += [ ":target_defaults" ]
sources = [ "util/key_reader.cc" ]
}
pkg_config("key_reader_config") {
pkg_deps = [ "xkbcommon" ]
}
executable("key_reader") {
configs += [
":target_defaults",
":key_reader_config",
]
deps = [ ":libkey_reader" ]
sources = [ "util/key_reader_main.cc" ]
}
pkg_config("cros_oobe_crypto_config") {
pkg_deps = [ "libcrypto" ]
}
executable("cros_oobe_crypto") {
configs += [
":cros_oobe_crypto_config",
":target_defaults",
]
sources = [ "util/cros_oobe_crypto.c" ]
}
if (use.mtd) {
pkg_config("nand_partition_config") {
pkg_deps = [ "libchrome" ]
}
executable("nand_partition") {
configs += [
":nand_partition_config",
":target_defaults",
]
deps = [ ":libcros_installer" ]
sources = [
"nand_partition.cc",
"nand_partition_main.cc",
]
}
}
if (!use.cros_host && use.test) {
pkg_config("cros_installer_test_config") {
pkg_deps = [
"libchrome",
"libchrome-test",
"xkbcommon",
]
}
executable("cros_installer_test") {
configs += [
"//common-mk:test",
":cros_installer_test_config",
":target_defaults",
]
deps = [
":libcros_installer",
":libkey_reader",
"//common-mk/testrunner:testrunner",
]
sources = [
"chromeos_install_config_test.cc",
"chromeos_legacy_test.cc",
"inst_util_test.cc",
"util/key_reader_test.cc",
]
if (use.enable_slow_boot_notify) {
sources += [ "slow_boot_notify_test.cc" ]
}
}
}