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

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: 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ":platform",
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" ]
106 94
107 if (!is_mac && !is_ios) { 95 if (!is_mac && !is_ios) {
108 sources -= [ 96 sources -= [
109 "apple_keychain.h", 97 "apple_keychain.h",
110 "mock_apple_keychain.cc", 98 "mock_apple_keychain.cc",
111 "mock_apple_keychain.h", 99 "mock_apple_keychain.h",
112 ] 100 ]
113 } 101 }
114 102
115 if (!is_linux) { 103 if (!is_linux) {
(...skipping 12 matching lines...) Expand all
128 "mac_security_services_lock.h", 116 "mac_security_services_lock.h",
129 ] 117 ]
130 } 118 }
131 if (!is_win) { 119 if (!is_win) {
132 sources -= [ 120 sources -= [
133 "capi_util.cc", 121 "capi_util.cc",
134 "capi_util.h", 122 "capi_util.h",
135 ] 123 ]
136 } 124 }
137 125
138 if (use_nss) { 126 if (!use_nss) {
139 configs += [ "//third_party/nss:nss_linux_config" ]
140 } else {
141 sources -= [ 127 sources -= [
142 "ec_private_key_nss.cc", 128 "ec_private_key_nss.cc",
143 "ec_signature_creator_nss.cc", 129 "ec_signature_creator_nss.cc",
144 "encryptor_nss.cc", 130 "encryptor_nss.cc",
145 "hmac_nss.cc", 131 "hmac_nss.cc",
146 "nss_util.cc", 132 "nss_util.cc",
147 "nss_util.h", 133 "nss_util.h",
148 "rsa_private_key_nss.cc", 134 "rsa_private_key_nss.cc",
149 "secure_hash_default.cc", 135 "secure_hash_default.cc",
150 "signature_creator_nss.cc", 136 "signature_creator_nss.cc",
(...skipping 17 matching lines...) Expand all
168 "openssl_util.h", 154 "openssl_util.h",
169 "rsa_private_key_openssl.cc", 155 "rsa_private_key_openssl.cc",
170 "secure_hash_openssl.cc", 156 "secure_hash_openssl.cc",
171 "signature_creator_openssl.cc", 157 "signature_creator_openssl.cc",
172 "signature_verifier_openssl.cc", 158 "signature_verifier_openssl.cc",
173 "symmetric_key_openssl.cc", 159 "symmetric_key_openssl.cc",
174 ] 160 ]
175 } 161 }
176 162
177 defines = [ "CRYPTO_IMPLEMENTATION" ] 163 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 } 164 }
184 165
185 # A minimal crypto subset for core features that small standalone targets can 166 # A minimal crypto subset for core features that small standalone targets can
186 # use to reduce code size. 167 # use to reduce code size.
187 static_library("crypto_minimal") { 168 source_set("crypto_minimal") {
188 sources = crypto_minimal_sources 169 sources = [
170 "hmac.cc",
171 "hmac.h",
172 "hmac_win.cc",
173 "secure_util.cc",
174 "secure_util.h",
175 "symmetric_key.h",
176 "symmetric_key_win.cc",
177 "third_party/nss/chromium-sha256.h",
178 "third_party/nss/sha512.cc",
179 ]
189 180
190 deps = [ 181 deps = [
182 ":platform",
191 "//base", 183 "//base",
192 "//base/third_party/dynamic_annotations", 184 "//base/third_party/dynamic_annotations",
193 ] 185 ]
194 186
195 defines = [ "CRYPTO_IMPLEMENTATION" ] 187 defines = [ "CRYPTO_IMPLEMENTATION" ]
196 } 188 }
197 189
198 test("crypto_unittests") { 190 test("crypto_unittests") {
199 sources = [ 191 sources = [
200 # Tests. 192 # Tests.
(...skipping 19 matching lines...) Expand all
220 ] 212 ]
221 213
222 if (use_openssl) { 214 if (use_openssl) {
223 sources -= [ 215 sources -= [
224 "nss_util_unittest.cc", 216 "nss_util_unittest.cc",
225 "openpgp_symmetric_encryption_unittest.cc", 217 "openpgp_symmetric_encryption_unittest.cc",
226 "rsa_private_key_nss_unittest.cc", 218 "rsa_private_key_nss_unittest.cc",
227 ] 219 ]
228 } 220 }
229 221
222 if (use_openssl || !is_linux) {
223 sources -= [
224 "rsa_private_key_nss_unittest.cc",
225 "openpgp_symmetric_encryption_unittest.cc",
226 ]
227 }
228
229 if (use_openssl) {
230 sources -= [ "nss_util_unittest.cc" ]
231 }
232
230 deps = [ 233 deps = [
231 ":crypto", 234 ":crypto",
235 ":platform",
232 "//base", 236 "//base",
233 "//base/test:run_all_unittests", 237 "//base/test:run_all_unittests",
234 "//base/test:test_support", 238 "//base/test:test_support",
235 "//testing/gmock", 239 "//testing/gmock",
236 "//testing/gtest", 240 "//testing/gtest",
237 ] 241 ]
242 }
238 243
239 if (is_mac) { 244 # This is a meta-target that forwards to NSS's SSL library or OpenSSL,
240 #deps += "//third_party/nss:nspr" 245 # according to the state of the crypto flags. A target just wanting to depend
246 # on the current SSL library should just depend on this.
247 group("platform") {
248 if (use_openssl) {
249 deps = [ "//third_party/openssl" ]
250 } else {
251 deps = [ "//net/third_party/nss/ssl:libssl" ]
252 if (is_linux) {
253 # On Linux, we use the system NSS (excepting SSL where we always use our
254 # own).
255 direct_dependent_configs = [
256 "//third_party/nss:system_nss_no_ssl_config"
257 ]
258 } else {
259 # Non-Linux platforms use the hermetic NSS from the tree.
260 deps += [ "//third_party/nss:nspr" ]
Ryan Sleevi 2014/04/14 20:30:22 I think this should be //third_party/nss:nss (the
261 }
241 } 262 }
242 } 263 }
OLDNEW
« 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