blob: 60036160f478b8dbe73837cb8c41f873d8f0dc88 [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 = [
":install_init_scripts",
":install_seccomp_policy",
":tpm2-simulator",
":tpm2-simulator-init",
":tpm2-simulator-stop",
]
}
pkg_config("target_default_deps") {
pkg_deps = [
"libbrillo",
"libchrome",
"libselinux",
"openssl",
]
}
config("target_defaults") {
configs = [ ":target_default_deps" ]
defines = [
"USE_TPM1=${use.tpm}",
"USE_TPM2=${use.tpm2}",
]
include_dirs = [ "${sysroot}/usr/include/pinweaver" ]
}
source_set("tpm_executor_version_library") {
sources = [ "tpm_executor_version.cc" ]
configs += [
":target_defaults",
"//common-mk:pic",
]
}
executable("tpm2-simulator") {
sources = [
"main.cc",
"simulator.cc",
"tpm_command_utils.cc",
"tpm_nvchip_utils.cc",
"tpm_vendor_cmd_locality.cc",
]
libs = []
configs += [ ":target_defaults" ]
install_path = "bin"
pkg_deps = [ "libminijail" ]
deps = [ ":tpm_executor_version_library" ]
if (use.tpm) {
sources += [ "tpm_executor_tpm1_impl.cc" ]
libs += [ "tpms" ]
}
if (use.tpm2) {
sources += [
"pinweaver_eal.cc",
"tpm_executor_tpm2_impl.cc",
"tpm_vendor_cmd_pinweaver.cc",
]
libs += [
"pinweaver",
"tpm2",
]
}
}
executable("tpm2-simulator-init") {
sources = [ "simulator-init.cc" ]
configs += [ ":target_defaults" ]
install_path = "bin"
pkg_deps = [ "vboot_host" ]
}
executable("tpm2-simulator-stop") {
sources = [ "simulator-stop.cc" ]
configs += [ ":target_defaults" ]
install_path = "bin"
pkg_deps = [ "vboot_host" ]
}
install_config("install_init_scripts") {
sources = [ "init/tpm2-simulator.conf" ]
install_path = "/etc/init"
}
# Install seccomp policy for cryptohome-proxy
install_config("install_seccomp_policy") {
sources = [ "seccomp/tpm2-simulator-" + getenv("ARCH") + ".policy" ]
install_path = "/usr/share/policy"
outputs = [ "tpm2-simulator.policy" ]
}