Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / net / third_party / nss / ssl / BUILD.gn
blobd8f796122b51e8ced044958f21af49e30b0f99e9
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.
5 config("ssl_config") {
6   include_dirs = [ "." ]
8   if (is_mac || is_win) {
9     defines = [ "NSS_PLATFORM_CLIENT_AUTH" ]
10   }
13 component("libssl") {
14   output_name = "crssl"
16   sources = [
17     "SSLerrs.h",
18     "authcert.c",
19     "bodge/secitem_array.c",
20     "cmpcert.c",
21     "derive.c",
22     "dtlscon.c",
23     "preenc.h",
24     "prelib.c",
25     "ssl.h",
26     "ssl3con.c",
27     "ssl3ecc.c",
28     "ssl3ext.c",
29     "ssl3gthr.c",
30     "ssl3prot.h",
31     "sslauth.c",
32     "sslcon.c",
33     "ssldef.c",
34     "sslenum.c",
35     "sslerr.c",
36     "sslerr.h",
37     "sslerrstrs.c",
38     "sslgathr.c",
39     "sslimpl.h",
40     "sslinfo.c",
41     "sslinit.c",
42     "sslmutex.c",
43     "sslmutex.h",
44     "sslnonce.c",
45     "sslplatf.c",
46     "sslproto.h",
47     "sslreveal.c",
48     "sslsecur.c",
49     "sslsnce.c",
50     "sslsock.c",
51     "sslt.h",
52     "ssltrace.c",
53     "sslver.c",
54     "unix_err.c",
55     "unix_err.h",
56     "win32err.c",
57     "win32err.h",
58   ]
60   public_configs = [ ":ssl_config" ]
62   cflags = []
63   defines = [
64     "NO_PKCS11_BYPASS",
65     "NSS_ENABLE_ECC",
66     "USE_UTIL_DIRECTLY",
67   ]
69   configs -= [ "//build/config/compiler:chromium_code" ]
70   configs += [ "//build/config/compiler:no_chromium_code" ]
72   if (is_win) {
73     sources -= [
74       "unix_err.c",
75       "unix_err.h",
76     ]
77     if (component_mode == "shared_library") {
78       ldflags = [ "/DEF:" + rebase_path("exports_win.def", root_build_dir) ]
79     }
80   } else if (is_linux) {
81     if (component_mode == "shared_library") {
82       configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
83     }
85     libs = [ "dl" ]
87     include_dirs = [ "bodge" ]
89     # Must be after ssl_config since we want our SSL headers to take
90     # precedence.
91     public_configs += [ "//third_party/nss:system_nss_no_ssl_config" ]
92   } else if (is_mac) {
93     libs = [ "Security.framework" ]
94   }
96   if (is_clang) {
97     # SSL triggers some of these Clang warnings.
98     configs -= [ "//build/config/clang:extra_warnings" ]
100     # There is a broken header guard in /usr/include/nss/secmod.h:
101     # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
102     cflags = [ "-Wno-header-guard" ]
103   }
105   if (is_posix) {
106     sources -= [
107       "win32err.c",
108       "win32err.h",
109     ]
110   }
112   if (is_mac || is_ios) {
113     defines += [
114       "XP_UNIX",
115       "DARWIN",
116       "XP_MACOSX",
117     ]
118   }
120   if (is_mac || is_ios || is_win) {
121     sources -= [ "bodge/secitem_array.c" ]
122     public_deps = [
123       "//third_party/nss:nspr",
124       "//third_party/nss:nss",
125     ]
126   }
128   if (is_debug) {
129     defines += [ "DEBUG" ]
130   }