blob: c5a29cd809a9e2aedc2396eb45c2c97318a7563d [file] [log] [blame]
# Copyright 2019 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 = [ ":libhwsec" ]
deps += [ ":libhwsec_test" ]
if (use.test) {
deps += [ ":hwsec_testrunner" ]
}
}
pkg_config("target_defaults") {
pkg_deps = [
"libbrillo",
"libchrome",
"openssl",
]
defines = [ "USE_TPM2=${use.tpm2}" ]
}
static_library("overalls_library") {
configs += [
":target_defaults",
"//common-mk:pic",
]
sources = [
"overalls/overalls_api.cc",
"overalls/overalls_singleton.cc",
]
}
static_library("libhwsec_test") {
configs += [
":target_defaults",
"//common-mk:nouse_thin_archive",
]
configs -= [ "//common-mk:use_thin_archive" ]
sources = []
if (!use.tpm2) {
sources += [ "test_utils/tpm1/test_fixture.cc" ]
}
}
config("libhwsec_tpm1_config") {
libs = [ "tspi" ]
}
shared_library("libhwsec") {
configs += [ ":target_defaults" ]
sources = [ "crypto_utility.cc" ]
if (!use.tpm2) {
deps = [ ":overalls_library" ]
all_dependent_configs = [ ":libhwsec_tpm1_config" ]
}
}
if (use.test) {
pkg_config("test_config") {
pkg_deps = [ "libchrome-test" ]
}
executable("hwsec_testrunner") {
configs += [
"//common-mk:test",
":target_defaults",
":test_config",
]
sources = [
"crypto_utility_test.cc",
"task_dispatching_framework_test.cc",
]
deps = [
":libhwsec",
":libhwsec_test",
"//common-mk/testrunner",
]
if (!use.tpm2) {
sources += [
"overalls/overalls_api_test.cc",
"overalls/overalls_singleton_test.cc",
]
}
}
}