chromium/chrome/browser/enterprise/connectors/device_trust/key_management/core/mac/BUILD.gn

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

source_set("mac") {
  public = [
    "metrics_util.h",
    "secure_enclave_client.h",
    "secure_enclave_helper.h",
    "secure_enclave_signing_key.h",
  ]

  sources = [
    "metrics_util.cc",
    "secure_enclave_client.cc",
    "secure_enclave_client_impl.h",
    "secure_enclave_client_impl.mm",
    "secure_enclave_helper.cc",
    "secure_enclave_helper_impl.h",
    "secure_enclave_helper_impl.mm",
    "secure_enclave_signing_key.cc",
  ]

  public_deps = [
    "//base",
    "//crypto",
    "//third_party/abseil-cpp:absl",
  ]

  deps = [
    "//chrome/browser/enterprise/connectors/device_trust/key_management/core:constants",
    "//third_party/boringssl",
  ]

  frameworks = [
    "CoreFoundation.framework",
    "CryptoTokenKit.framework",
    "Foundation.framework",
    "Security.framework",
  ]
}

source_set("test_support") {
  testonly = true
  public = [
    "mock_secure_enclave_client.h",
    "mock_secure_enclave_helper.h",
  ]

  sources = [
    "mock_secure_enclave_client.cc",
    "mock_secure_enclave_helper.cc",
  ]

  frameworks = [ "Security.framework" ]

  public_deps = [
    ":mac",
    "//testing/gmock",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "secure_enclave_client_unittest.mm",
    "secure_enclave_signing_key_unittest.mm",
  ]

  deps = [
    ":mac",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//chrome/browser/enterprise/connectors/device_trust/key_management/core:constants",
    "//testing/gmock",
    "//testing/gtest",
  ]

  frameworks = [
    "Foundation.framework",
    "Security.framework",
  ]
}