Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: crypto/BUILD.gn

Issue 231673006: Add SSL support to the GN build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/linux/pkg_config.gni ('k') | net/third_party/nss/ssl/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crypto/BUILD.gn
diff --git a/tools/gn/secondary/crypto/BUILD.gn b/crypto/BUILD.gn
similarity index 81%
rename from tools/gn/secondary/crypto/BUILD.gn
rename to crypto/BUILD.gn
index 50365c98d3d7232a82646b6d3ad8c3281f46bfea..af980ed78b5c3914ee751e4f3174b5724423bfc0 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,11 @@ component("crypto") {
]
deps = [
+ ":crypto_minimal",
+ ":platform",
"//base",
"//base/third_party/dynamic_annotations",
- "//crypto/ssl:metassl",
]
- forward_dependent_configs_from = [ "//crypto/ssl:metassl" ]
if (!is_mac && !is_ios) {
sources -= [
@@ -135,9 +123,7 @@ component("crypto") {
]
}
- if (use_nss) {
- configs += [ "//third_party/nss:nss_linux_config" ]
- } else {
+ if (!use_nss) {
sources -= [
"ec_private_key_nss.cc",
"ec_signature_creator_nss.cc",
@@ -175,19 +161,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") {
+ 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 = [
+ ":platform",
"//base",
"//base/third_party/dynamic_annotations",
]
@@ -227,16 +219,45 @@ 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",
+ ":platform",
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
]
+}
- if (is_mac) {
- #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("platform") {
+ if (use_openssl) {
+ deps = [ "//third_party/openssl" ]
+ } else {
+ deps = [ "//net/third_party/nss/ssl:libssl" ]
+ if (is_linux) {
+ # On Linux, we use the system NSS (excepting SSL where we always use our
+ # own).
+ direct_dependent_configs = [
+ "//third_party/nss:system_nss_no_ssl_config"
+ ]
+ } else {
+ # Non-Linux platforms use the hermetic NSS from the tree.
+ deps += [ "//third_party/nss:nspr" ]
Ryan Sleevi 2014/04/14 20:30:22 I think this should be //third_party/nss:nss (the
+ }
}
}
« no previous file with comments | « build/config/linux/pkg_config.gni ('k') | net/third_party/nss/ssl/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698