| # 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 = [ ":tpm_softclear" ] |
| if (use.test) { |
| deps += [ ":tpm_softclear_utils_testrunner" ] |
| } |
| } |
| |
| executable("tpm_softclear") { |
| configs += [ ":target_defaults" ] |
| sources = [ "main.cc" ] |
| deps = [ ":utility_library" ] |
| pkg_deps = [ "libbrillo" ] |
| } |
| |
| pkg_config("target_defaults") { |
| defines = [ "USE_TPM2=${use.tpm2}" ] |
| pkg_deps = [ "libchrome-${libbase_ver}" ] |
| } |
| |
| static_library("utility_library") { |
| configs += [ ":target_defaults" ] |
| sources = [ "tpm.cc" ] |
| if (use.tpm2) { |
| sources += [ "tpm2_impl.cc" ] |
| libs = [ "trunks" ] |
| |
| # NOSORT |
| pkg_deps = [ |
| # system_api depends on protobuf. It must appear before protobuf here or the |
| # linker flags won't be in the right order. |
| "system_api", |
| "protobuf-lite", |
| ] |
| } else { |
| sources += [ "tpm_impl.cc" ] |
| } |
| } |
| |
| if (use.test) { |
| pkg_config("tpm_softclear_utils_testrunner_config") { |
| pkg_deps = [ "libchrome-test-${libbase_ver}" ] |
| } |
| |
| executable("tpm_softclear_utils_testrunner") { |
| configs += [ |
| ":target_defaults", |
| ":tpm_softclear_utils_testrunner_config", |
| "//common-mk:test", |
| ] |
| if (use.tpm2) { |
| sources = [ "tpm2_test.cc" ] |
| libs = [ "trunks_test" ] |
| } |
| deps = [ |
| ":utility_library", |
| "//common-mk/testrunner", |
| ] |
| } |
| } |