chromium/chromeos/ash/components/tpm/BUILD.gn

# Copyright 2019 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/buildflag_header.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//chromeos/ash/components/tpm/buildflags.gni")
import("//testing/test.gni")

assert(is_chromeos_ash)

buildflag_header("buildflags") {
  header = "buildflags.h"
  flags = [ "NSS_SLOTS_SOFTWARE_FALLBACK=$nss_slots_software_fallback" ]
}

component("tpm") {
  defines = [ "IS_CHROMEOS_ASH_COMPONENTS_TPM_IMPL" ]
  deps = [
    ":buildflags",
    "//base",
    "//chromeos/ash/components/cryptohome",
    "//chromeos/ash/components/dbus/cryptohome",
    "//chromeos/ash/components/dbus/cryptohome:cryptohome_proto",
    "//chromeos/ash/components/dbus/userdataauth",
    "//chromeos/ash/components/dbus/userdataauth:userdataauth_proto",
    "//chromeos/ash/components/login/login_state",
    "//chromeos/dbus/constants",
    "//chromeos/dbus/tpm_manager",
    "//chromeos/dbus/tpm_manager:tpm_manager_proto",
    "//components/account_id",
    "//crypto",
  ]
  sources = [
    "prepare_tpm.cc",
    "prepare_tpm.h",
    "tpm_token_info_getter.cc",
    "tpm_token_info_getter.h",
    "tpm_token_loader.cc",
    "tpm_token_loader.h",
  ]
}

source_set("unit_tests") {
  testonly = true
  deps = [
    ":tpm",
    "//base/test:test_support",
    "//chromeos/ash/components/cryptohome",
    "//chromeos/ash/components/dbus:test_support",
    "//chromeos/ash/components/dbus/cryptohome",
    "//chromeos/ash/components/dbus/cryptohome:cryptohome_proto",
    "//chromeos/ash/components/dbus/userdataauth",
    "//chromeos/ash/components/dbus/userdataauth:userdataauth_proto",
    "//chromeos/dbus/constants",
    "//chromeos/dbus/tpm_manager",
    "//chromeos/dbus/tpm_manager:tpm_manager_proto",
    "//testing/gtest",
  ]
  sources = [
    "prepare_tpm_unittest.cc",
    "tpm_token_info_getter_unittest.cc",
  ]
}