Chromium Code Reviews| Index: crypto/BUILD.gn |
| diff --git a/tools/gn/secondary/crypto/BUILD.gn b/crypto/BUILD.gn |
| similarity index 83% |
| rename from tools/gn/secondary/crypto/BUILD.gn |
| rename to crypto/BUILD.gn |
| index 50365c98d3d7232a82646b6d3ad8c3281f46bfea..74661b241f9effb94fab47221001ea4249ff4596 100644 |
| --- a/tools/gn/secondary/crypto/BUILD.gn |
| +++ b/crypto/BUILD.gn |
| @@ -4,18 +4,6 @@ |
| import("//build/config/crypto.gni") |
| -crypto_minimal_sources = [ |
| - "hmac.cc", |
| - "hmac.h", |
| - "hmac_win.cc", |
| - "secure_util.cc", |
| - "secure_util.h", |
| - "symmetric_key.h", |
| - "symmetric_key_win.cc", |
| - "third_party/nss/chromium-sha256.h", |
| - "third_party/nss/sha512.cc", |
| -] |
| - |
| component("crypto") { |
| output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto. |
| sources = [ |
| @@ -98,11 +86,12 @@ component("crypto") { |
| ] |
| deps = [ |
| + ":crypto_minimal", |
| + ":ssl", |
| "//base", |
| "//base/third_party/dynamic_annotations", |
| - "//crypto/ssl:metassl", |
| ] |
| - forward_dependent_configs_from = [ "//crypto/ssl:metassl" ] |
| + forward_dependent_configs_from = [ ":ssl" ] |
| if (!is_mac && !is_ios) { |
| sources -= [ |
| @@ -175,19 +164,25 @@ component("crypto") { |
| } |
| defines = [ "CRYPTO_IMPLEMENTATION" ] |
| - |
| - # TODO(brettw) once GYP compat is no longer necessary, just move |
| - # crypto_minimal_sources to the crypto_minimal target and include a |
| - # dependency on it here. |
| - sources += crypto_minimal_sources |
| } |
| # A minimal crypto subset for core features that small standalone targets can |
| # use to reduce code size. |
| -static_library("crypto_minimal") { |
| - sources = crypto_minimal_sources |
| +source_set("crypto_minimal") { |
|
brettw
2014/04/11 21:21:44
This is a sort-of-replacement for the hmac_sources
|
| + sources = [ |
| + "hmac.cc", |
| + "hmac.h", |
| + "hmac_win.cc", |
| + "secure_util.cc", |
| + "secure_util.h", |
| + "symmetric_key.h", |
| + "symmetric_key_win.cc", |
| + "third_party/nss/chromium-sha256.h", |
| + "third_party/nss/sha512.cc", |
| + ] |
| deps = [ |
| + ":ssl", |
| "//base", |
| "//base/third_party/dynamic_annotations", |
| ] |
| @@ -227,6 +222,17 @@ test("crypto_unittests") { |
| ] |
| } |
| + if (use_openssl || !is_linux) { |
| + sources -= [ |
| + "rsa_private_key_nss_unittest.cc", |
| + "openpgp_symmetric_encryption_unittest.cc", |
| + ] |
| + } |
| + |
| + if (use_openssl) { |
| + sources -= [ "nss_util_unittest.cc" ] |
| + } |
| + |
| deps = [ |
| ":crypto", |
| "//base", |
| @@ -236,7 +242,22 @@ test("crypto_unittests") { |
| "//testing/gtest", |
| ] |
| - if (is_mac) { |
| - #deps += "//third_party/nss:nspr" |
| + if (is_linux) { |
| + deps += [ ":ssl" ] |
| + } |
| + |
| + if (!use_openssl && (is_mac || is_ios || is_win)) { |
| + deps += "//third_party/nss:nspr" |
| + } |
| +} |
| + |
| +# This is a meta-target that forwards to NSS's SSL library or OpenSSL, |
| +# according to the state of the crypto flags. A target just wanting to depend |
| +# on the current SSL library should just depend on this. |
| +group("ssl") { |
| + if (use_openssl) { |
| + deps = [ "//third_party/openssl" ] |
| + } else { |
| + deps = [ "//net/third_party/nss/ssl:libssl" ] |
| } |
| } |