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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/crypto.gni") 5 import("//build/config/crypto.gni")
6 6
7 crypto_minimal_sources = [
8 "hmac.cc",
9 "hmac.h",
10 "hmac_win.cc",
11 "secure_util.cc",
12 "secure_util.h",
13 "symmetric_key.h",
14 "symmetric_key_win.cc",
15 "third_party/nss/chromium-sha256.h",
16 "third_party/nss/sha512.cc",
17 ]
18
19 component("crypto") { 7 component("crypto") {
20 output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto. 8 output_name = "crcrypto" # Avoid colliding with OpenSSL's libcrypto.
21 sources = [ 9 sources = [
22 "apple_keychain.h", 10 "apple_keychain.h",
23 "apple_keychain_ios.mm", 11 "apple_keychain_ios.mm",
24 "apple_keychain_mac.mm", 12 "apple_keychain_mac.mm",
25 "capi_util.cc", 13 "capi_util.cc",
26 "capi_util.h", 14 "capi_util.h",
27 "crypto_export.h", 15 "crypto_export.h",
28 "crypto_module_blocking_password_delegate.h", 16 "crypto_module_blocking_password_delegate.h",
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 "symmetric_key_openssl.cc", 79 "symmetric_key_openssl.cc",
92 "third_party/nss/chromium-blapi.h", 80 "third_party/nss/chromium-blapi.h",
93 "third_party/nss/chromium-blapit.h", 81 "third_party/nss/chromium-blapit.h",
94 "third_party/nss/chromium-nss.h", 82 "third_party/nss/chromium-nss.h",
95 "third_party/nss/pk11akey.cc", 83 "third_party/nss/pk11akey.cc",
96 "third_party/nss/rsawrapr.c", 84 "third_party/nss/rsawrapr.c",
97 "third_party/nss/secsign.cc", 85 "third_party/nss/secsign.cc",
98 ] 86 ]
99 87
100 deps = [ 88 deps = [
89 ":crypto_minimal",
90 ":ssl",
101 "//base", 91 "//base",
102 "//base/third_party/dynamic_annotations", 92 "//base/third_party/dynamic_annotations",
103 "//crypto/ssl:metassl",
104 ] 93 ]
105 forward_dependent_configs_from = [ "//crypto/ssl:metassl" ] 94 forward_dependent_configs_from = [ ":ssl" ]
106 95
107 if (!is_mac && !is_ios) { 96 if (!is_mac && !is_ios) {
108 sources -= [ 97 sources -= [
109 "apple_keychain.h", 98 "apple_keychain.h",
110 "mock_apple_keychain.cc", 99 "mock_apple_keychain.cc",
111 "mock_apple_keychain.h", 100 "mock_apple_keychain.h",
112 ] 101 ]
113 } 102 }
114 103
115 if (!is_linux) { 104 if (!is_linux) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 "openssl_util.h", 157 "openssl_util.h",
169 "rsa_private_key_openssl.cc", 158 "rsa_private_key_openssl.cc",
170 "secure_hash_openssl.cc", 159 "secure_hash_openssl.cc",
171 "signature_creator_openssl.cc", 160 "signature_creator_openssl.cc",
172 "signature_verifier_openssl.cc", 161 "signature_verifier_openssl.cc",
173 "symmetric_key_openssl.cc", 162 "symmetric_key_openssl.cc",
174 ] 163 ]
175 } 164 }
176 165
177 defines = [ "CRYPTO_IMPLEMENTATION" ] 166 defines = [ "CRYPTO_IMPLEMENTATION" ]
178
179 # TODO(brettw) once GYP compat is no longer necessary, just move
180 # crypto_minimal_sources to the crypto_minimal target and include a
181 # dependency on it here.
182 sources += crypto_minimal_sources
183 } 167 }
184 168
185 # A minimal crypto subset for core features that small standalone targets can 169 # A minimal crypto subset for core features that small standalone targets can
186 # use to reduce code size. 170 # use to reduce code size.
187 static_library("crypto_minimal") { 171 source_set("crypto_minimal") {
brettw 2014/04/11 21:21:44 This is a sort-of-replacement for the hmac_sources
188 sources = crypto_minimal_sources 172 sources = [
173 "hmac.cc",
174 "hmac.h",
175 "hmac_win.cc",
176 "secure_util.cc",
177 "secure_util.h",
178 "symmetric_key.h",
179 "symmetric_key_win.cc",
180 "third_party/nss/chromium-sha256.h",
181 "third_party/nss/sha512.cc",
182 ]
189 183
190 deps = [ 184 deps = [
185 ":ssl",
191 "//base", 186 "//base",
192 "//base/third_party/dynamic_annotations", 187 "//base/third_party/dynamic_annotations",
193 ] 188 ]
194 189
195 defines = [ "CRYPTO_IMPLEMENTATION" ] 190 defines = [ "CRYPTO_IMPLEMENTATION" ]
196 } 191 }
197 192
198 test("crypto_unittests") { 193 test("crypto_unittests") {
199 sources = [ 194 sources = [
200 # Tests. 195 # Tests.
(...skipping 19 matching lines...) Expand all
220 ] 215 ]
221 216
222 if (use_openssl) { 217 if (use_openssl) {
223 sources -= [ 218 sources -= [
224 "nss_util_unittest.cc", 219 "nss_util_unittest.cc",
225 "openpgp_symmetric_encryption_unittest.cc", 220 "openpgp_symmetric_encryption_unittest.cc",
226 "rsa_private_key_nss_unittest.cc", 221 "rsa_private_key_nss_unittest.cc",
227 ] 222 ]
228 } 223 }
229 224
225 if (use_openssl || !is_linux) {
226 sources -= [
227 "rsa_private_key_nss_unittest.cc",
228 "openpgp_symmetric_encryption_unittest.cc",
229 ]
230 }
231
232 if (use_openssl) {
233 sources -= [ "nss_util_unittest.cc" ]
234 }
235
230 deps = [ 236 deps = [
231 ":crypto", 237 ":crypto",
232 "//base", 238 "//base",
233 "//base/test:run_all_unittests", 239 "//base/test:run_all_unittests",
234 "//base/test:test_support", 240 "//base/test:test_support",
235 "//testing/gmock", 241 "//testing/gmock",
236 "//testing/gtest", 242 "//testing/gtest",
237 ] 243 ]
238 244
239 if (is_mac) { 245 if (is_linux) {
240 #deps += "//third_party/nss:nspr" 246 deps += [ ":ssl" ]
247 }
248
249 if (!use_openssl && (is_mac || is_ios || is_win)) {
250 deps += "//third_party/nss:nspr"
241 } 251 }
242 } 252 }
253
254 # This is a meta-target that forwards to NSS's SSL library or OpenSSL,
255 # according to the state of the crypto flags. A target just wanting to depend
256 # on the current SSL library should just depend on this.
257 group("ssl") {
258 if (use_openssl) {
259 deps = [ "//third_party/openssl" ]
260 } else {
261 deps = [ "//net/third_party/nss/ssl:libssl" ]
262 }
263 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698