Commit bb05f532 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

Convert //crypto to not depend on set_sources_assignment_filter()

set_sources_assignment_filter() is considered as a mis-feature
of gn (as it makes it difficult to reason about the BUILD.gn
files individually).

Bug: 1018739
Change-Id: I4eab62eccbe0ef16904dcdb21a89d6f484be00a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2409694
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarAdam Langley <agl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806968}
parent 288ecf62
...@@ -5,16 +5,17 @@ ...@@ -5,16 +5,17 @@
import("//build/config/crypto.gni") import("//build/config/crypto.gni")
import("//testing/test.gni") import("//testing/test.gni")
# Reset sources_assignment_filter for the BUILD.gn file to prevent
# regression during the migration of Chromium away from the feature.
# See docs/no_sources_assignment_filter.md for more information.
# TODO(crbug.com/1018739): remove this when migration is done.
set_sources_assignment_filter([])
component("crypto") { component("crypto") {
output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto. output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto.
sources = [ sources = [
"aead.cc", "aead.cc",
"aead.h", "aead.h",
"apple_keychain.h",
"apple_keychain_ios.mm",
"apple_keychain_mac.mm",
"capi_util.cc",
"capi_util.h",
"crypto_export.h", "crypto_export.h",
"ec_private_key.cc", "ec_private_key.cc",
"ec_private_key.h", "ec_private_key.h",
...@@ -28,21 +29,6 @@ component("crypto") { ...@@ -28,21 +29,6 @@ component("crypto") {
"hkdf.h", "hkdf.h",
"hmac.cc", "hmac.cc",
"hmac.h", "hmac.h",
"mac_security_services_lock.cc",
"mac_security_services_lock.h",
# TODO(brettw) these mocks should be moved to a test_support_crypto target
# if possible.
"mock_apple_keychain.cc",
"mock_apple_keychain.h",
"mock_apple_keychain_ios.cc",
"mock_apple_keychain_mac.cc",
"nss_crypto_module_delegate.h",
"nss_key_util.cc",
"nss_key_util.h",
"nss_util.cc",
"nss_util.h",
"nss_util_internal.h",
"openssl_util.cc", "openssl_util.cc",
"openssl_util.h", "openssl_util.h",
"p224.cc", "p224.cc",
...@@ -77,35 +63,58 @@ component("crypto") { ...@@ -77,35 +63,58 @@ component("crypto") {
public_deps = [ "//third_party/boringssl" ] public_deps = [ "//third_party/boringssl" ]
if (!is_apple) { if (is_apple) {
sources -= [ sources += [
"apple_keychain.h", "apple_keychain.h",
# TODO(brettw): these mocks should be moved to a test_support_crypto
# target if possible.
"mock_apple_keychain.cc", "mock_apple_keychain.cc",
"mock_apple_keychain.h", "mock_apple_keychain.h",
] ]
} else {
if (is_mac) {
sources += [
"apple_keychain_mac.mm",
# TODO(brettw): these mocks should be moved to a test_support_crypto
# target if possible.
"mock_apple_keychain_mac.cc",
]
}
if (is_ios) {
sources += [
"apple_keychain_ios.mm",
# TODO(brettw): these mocks should be moved to a test_support_crypto
# target if possible.
"mock_apple_keychain_ios.cc",
]
}
frameworks = [ frameworks = [
"CoreFoundation.framework", "CoreFoundation.framework",
"Security.framework", "Security.framework",
] ]
} }
if (!is_mac) { if (is_mac) {
sources -= [ sources += [
"mac_security_services_lock.cc", "mac_security_services_lock.cc",
"mac_security_services_lock.h", "mac_security_services_lock.h",
] ]
} }
if (!is_win) { if (is_win) {
sources -= [ sources += [
"capi_util.cc", "capi_util.cc",
"capi_util.h", "capi_util.h",
] ]
} }
# Some files are built when NSS is used for the platform certificate library. # Some files are built when NSS is used for the platform certificate library.
if (!use_nss_certs) { if (use_nss_certs) {
sources -= [ sources += [
"nss_crypto_module_delegate.h",
"nss_key_util.cc", "nss_key_util.cc",
"nss_key_util.h", "nss_key_util.h",
"nss_util.cc", "nss_util.cc",
...@@ -132,8 +141,6 @@ test("crypto_unittests") { ...@@ -132,8 +141,6 @@ test("crypto_unittests") {
"ec_signature_creator_unittest.cc", "ec_signature_creator_unittest.cc",
"encryptor_unittest.cc", "encryptor_unittest.cc",
"hmac_unittest.cc", "hmac_unittest.cc",
"nss_key_util_unittest.cc",
"nss_util_unittest.cc",
"p224_spake_unittest.cc", "p224_spake_unittest.cc",
"p224_unittest.cc", "p224_unittest.cc",
"random_unittest.cc", "random_unittest.cc",
...@@ -146,8 +153,8 @@ test("crypto_unittests") { ...@@ -146,8 +153,8 @@ test("crypto_unittests") {
] ]
# Some files are built when NSS is used for the platform certificate library. # Some files are built when NSS is used for the platform certificate library.
if (!use_nss_certs) { if (use_nss_certs) {
sources -= [ sources += [
"nss_key_util_unittest.cc", "nss_key_util_unittest.cc",
"nss_util_unittest.cc", "nss_util_unittest.cc",
] ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment