Remove friend classes from PasswordStore.
[chromium-blink-merge.git] / crypto / crypto.gyp
blobe43f976e3e97899b4576623f30891dc09d0020e2
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   'variables': {
7     'chromium_code': 1,
8   },
9   'includes': [
10     'crypto.gypi',
11   ],
12   'targets': [
13     {
14       'target_name': 'crypto',
15       'type': '<(component)',
16       'product_name': 'crcrypto',  # Avoid colliding with OpenSSL's libcrypto
17       'dependencies': [
18         '../base/base.gyp:base',
19         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
20       ],
21       'defines': [
22         'CRYPTO_IMPLEMENTATION',
23       ],
24       'msvs_disabled_warnings': [
25         4018,
26       ],
27       'conditions': [
28         [ 'os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
29           'dependencies': [
30             '../build/linux/system.gyp:ssl',
31           ],
32           'export_dependent_settings': [
33             '../build/linux/system.gyp:ssl',
34           ],
35           'conditions': [
36             [ 'chromeos==1', {
37                 'sources/': [ ['include', '_chromeos\\.cc$'] ]
38               },
39             ],
40           ],
41         }, {  # os_posix != 1 or OS == "mac" or OS == "ios" or OS == "android"
42             'sources!': [
43               'hmac_win.cc',
44               'symmetric_key_win.cc',
45             ],
46         }],
47         [ 'OS != "mac" and OS != "ios"', {
48           'sources!': [
49             'apple_keychain.h',
50             'mock_apple_keychain.cc',
51             'mock_apple_keychain.h',
52           ],
53         }],
54         [ 'OS == "android"', {
55             'includes': [
56               '../build/android/cpufeatures.gypi',
57             ],
58         }],
59         [ 'os_bsd==1', {
60           'link_settings': {
61             'libraries': [
62               '-L/usr/local/lib -lexecinfo',
63               ],
64             },
65           },
66         ],
67         [ 'OS == "mac"', {
68           'link_settings': {
69             'libraries': [
70               '$(SDKROOT)/System/Library/Frameworks/Security.framework',
71             ],
72           },
73         }, {  # OS != "mac"
74           'sources!': [
75             'cssm_init.cc',
76             'cssm_init.h',
77             'mac_security_services_lock.cc',
78             'mac_security_services_lock.h',
79           ],
80         }],
81         [ 'use_openssl == 0 and (OS == "mac" or OS == "ios" or OS == "win")', {
82           'dependencies': [
83             '../third_party/nss/nss.gyp:nspr',
84             '../third_party/nss/nss.gyp:nss',
85           ],
86           'export_dependent_settings': [
87             '../third_party/nss/nss.gyp:nspr',
88             '../third_party/nss/nss.gyp:nss',
89           ],
90         }],
91         [ 'OS != "win"', {
92           'sources!': [
93             'capi_util.h',
94             'capi_util.cc',
95           ],
96         }],
97         [ 'OS == "win"', {
98           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
99           'msvs_disabled_warnings': [4267, ],
100         }],
101         [ 'use_openssl==1', {
102             'dependencies': [
103               '../third_party/openssl/openssl.gyp:openssl',
104             ],
105             # TODO(joth): Use a glob to match exclude patterns once the
106             #             OpenSSL file set is complete.
107             'sources!': [
108               'ec_private_key_nss.cc',
109               'ec_signature_creator_nss.cc',
110               'encryptor_nss.cc',
111               'hmac_nss.cc',
112               'nss_util.cc',
113               'nss_util.h',
114               'rsa_private_key_nss.cc',
115               'secure_hash_default.cc',
116               'signature_creator_nss.cc',
117               'signature_verifier_nss.cc',
118               'symmetric_key_nss.cc',
119               'third_party/nss/chromium-blapi.h',
120               'third_party/nss/chromium-blapit.h',
121               'third_party/nss/chromium-nss.h',
122               'third_party/nss/chromium-prtypes.h',
123               'third_party/nss/chromium-sha256.h',
124               'third_party/nss/pk11akey.cc',
125               'third_party/nss/rsawrapr.c',
126               'third_party/nss/secsign.cc',
127               'third_party/nss/sha512.cc',
128             ],
129           }, {
130             'sources!': [
131               'ec_private_key_openssl.cc',
132               'ec_signature_creator_openssl.cc',
133               'encryptor_openssl.cc',
134               'hmac_openssl.cc',
135               'openssl_util.cc',
136               'openssl_util.h',
137               'rsa_private_key_openssl.cc',
138               'secure_hash_openssl.cc',
139               'signature_creator_openssl.cc',
140               'signature_verifier_openssl.cc',
141               'symmetric_key_openssl.cc',
142             ],
143         },],
144       ],
145       'sources': [
146         '<@(crypto_sources)',
147       ],
148     },
149     {
150       'target_name': 'crypto_unittests',
151       'type': 'executable',
152       'sources': [
153         'curve25519_unittest.cc',
154         'ec_private_key_unittest.cc',
155         'ec_signature_creator_unittest.cc',
156         'encryptor_unittest.cc',
157         'ghash_unittest.cc',
158         'hkdf_unittest.cc',
159         'hmac_unittest.cc',
160         'nss_util_unittest.cc',
161         'p224_unittest.cc',
162         'p224_spake_unittest.cc',
163         'random_unittest.cc',
164         'rsa_private_key_unittest.cc',
165         'rsa_private_key_nss_unittest.cc',
166         'secure_hash_unittest.cc',
167         'sha2_unittest.cc',
168         'signature_creator_unittest.cc',
169         'signature_verifier_unittest.cc',
170         'symmetric_key_unittest.cc',
171       ],
172       'dependencies': [
173         'crypto',
174         '../base/base.gyp:base',
175         '../base/base.gyp:run_all_unittests',
176         '../base/base.gyp:test_support_base',
177         '../testing/gmock.gyp:gmock',
178         '../testing/gtest.gyp:gtest',
179       ],
180       'conditions': [
181         [ 'os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
182           'conditions': [
183             # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
184             [ '(use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1)', {
185                 'dependencies': [
186                   '../base/allocator/allocator.gyp:allocator',
187                 ],
188               },
189             ],
190           ],
191           'dependencies': [
192             '../build/linux/system.gyp:ssl',
193           ],
194         }, {  # os_posix != 1 or OS == "mac" or OS == "android" or OS == "ios"
195           'sources!': [
196             'rsa_private_key_nss_unittest.cc',
197           ]
198         }],
199         [ 'use_openssl == 0 and (OS == "mac" or OS == "ios" or OS == "win")', {
200           'dependencies': [
201             '../third_party/nss/nss.gyp:nspr',
202           ],
203         }],
204         [ 'OS == "win"', {
205           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
206           'msvs_disabled_warnings': [4267, ],
207         }],
208         [ 'use_openssl==1', {
209           'sources!': [
210             'nss_util_unittest.cc',
211             'rsa_private_key_nss_unittest.cc',
212           ],
213         }],
214       ],
215     },
216   ],
217   'conditions': [
218     ['OS == "win" and target_arch=="ia32"', {
219       'targets': [
220         {
221           'target_name': 'crypto_nacl_win64',
222           # We do not want nacl_helper to depend on NSS because this would
223           # require including a 64-bit copy of NSS. Thus, use the native APIs
224           # for the helper.
225           'type': '<(component)',
226           'dependencies': [
227             '../base/base.gyp:base_win64',
228             '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64',
229           ],
230           'sources': [
231             '<@(hmac_win64_related_sources)',
232           ],
233           'defines': [
234            'CRYPTO_IMPLEMENTATION',
235            '<@(nacl_win64_defines)',
236           ],
237           'msvs_disabled_warnings': [
238             4018,
239           ],
240           'configurations': {
241             'Common_Base': {
242               'msvs_target_platform': 'x64',
243             },
244           },
245         },
246       ],
247     }],
248   ],