Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / net / third_party / nss / ssl / BUILD.gn
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
3 # found in the LICENSE file.
4
5 config("ssl_config") {
6   include_dirs = [ "." ]
7
8   if (is_mac || is_win) {
9     defines = [ "NSS_PLATFORM_CLIENT_AUTH" ]
10   }
11 }
12
13 component("libssl") {
14   output_name = "crssl"
15
16   sources = [
17     "authcert.c",
18     "cmpcert.c",
19     "derive.c",
20     "dtlscon.c",
21     "preenc.h",
22     "prelib.c",
23     "ssl.h",
24     "ssl3con.c",
25     "ssl3ecc.c",
26     "ssl3ext.c",
27     "ssl3gthr.c",
28     "ssl3prot.h",
29     "sslauth.c",
30     "sslcon.c",
31     "ssldef.c",
32     "sslenum.c",
33     "sslerr.c",
34     "sslerr.h",
35     "SSLerrs.h",
36     "sslerrstrs.c",
37     "sslgathr.c",
38     "sslimpl.h",
39     "sslinfo.c",
40     "sslinit.c",
41     "sslmutex.c",
42     "sslmutex.h",
43     "sslnonce.c",
44     "sslplatf.c",
45     "sslproto.h",
46     "sslreveal.c",
47     "sslsecur.c",
48     "sslsnce.c",
49     "sslsock.c",
50     "sslt.h",
51     "ssltrace.c",
52     "sslver.c",
53     "unix_err.c",
54     "unix_err.h",
55     "win32err.c",
56     "win32err.h",
57     "bodge/secitem_array.c",
58   ]
59
60   public_configs = [ ":ssl_config" ]
61
62   cflags = []
63   defines = [
64     "NO_PKCS11_BYPASS",
65     "NSS_ENABLE_ECC",
66     "USE_UTIL_DIRECTLY",
67   ]
68
69   configs -= [ "//build/config/compiler:chromium_code" ]
70   configs += [ "//build/config/compiler:no_chromium_code" ]
71
72   if (is_win) {
73     cflags += [ "/wd4267" ]  # Disable warning: Conversion from size_t to 'type'.
74
75     sources -= [
76       "unix_err.c",
77       "unix_err.h",
78     ]
79     sources += [ "exports_win.def" ]
80   } else if (is_linux) {
81     if (component_mode == "shared_library") {
82       configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
83     }
84
85     libs = [ "dl" ]
86
87     include_dirs = [ "bodge" ]
88
89     # Must be after ssl_config since we want our SSL headers to take
90     # precedence.
91     public_configs += [
92       "//third_party/nss:system_nss_no_ssl_config"
93     ]
94   } else if (is_mac) {
95     libs = [ "Security.framework" ]
96   }
97
98   if (is_posix) {
99     sources -= [
100       "win32err.c",
101       "win32err.h",
102     ]
103   }
104
105   if (is_mac || is_ios) {
106     defines += [
107       "XP_UNIX",
108       "DARWIN",
109       "XP_MACOSX",
110     ]
111   }
112
113   if (is_mac || is_ios || is_win) {
114     sources -= [
115       "bodge/secitem_array.c",
116     ]
117     public_deps = [
118       "//third_party/nss:nspr",
119       "//third_party/nss:nss",
120     ]
121   }
122
123   if (is_clang) {
124     cflags += [
125       # See http://crbug.com/138571#c8. In short, sslsecur.c picks up the
126       # system's cert.h because cert.h isn't in chromium's repo.
127       "-Wno-incompatible-pointer-types",
128
129       # There is a broken header guard in /usr/include/nss/secmod.h:
130       # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
131       "-Wno-header-guard",
132     ]
133   }
134
135   if (is_debug) {
136     defines += [ "DEBUG" ]
137   }
138 }