EnrollmentScreen source code cosmetics.
[chromium-blink-merge.git] / third_party / boringssl / BUILD.gn
blob468d17c6a8239c8195b540a20d97be20147e0972
1 # Copyright 2014 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 for us and everybody else depending on BoringSSL.
6 config("openssl_config") {
7   include_dirs = []
8   include_dirs += [ "src/include" ]
11 # Config internal to this build file.
12 config("openssl_internal_config") {
13   visibility = ":*"  # Only targets in this file can depend on this.
16 # The list of BoringSSL files is kept in boringssl.gypi.
17 gypi_values = exec_script(
18     "//build/gypi_to_gn.py",
19     [ rebase_path("//third_party/boringssl/boringssl.gypi") ],
20     "scope",
21     [ "//third_party/boringssl/boringssl.gypi" ])
23 component("boringssl") {
24   sources = gypi_values.boringssl_lib_sources
26   direct_dependent_configs = [ ":openssl_config" ]
28   cflags = []
30   configs -= [ "//build/config/compiler:chromium_code" ]
31   configs += [ "//build/config/compiler:no_chromium_code" ]
33   # Also gets the include dirs from :openssl_config
34   include_dirs = [
35     "src/include",
36     # This is for arm_arch.h, which is needed by some asm files. Since the
37     # asm files are generated and kept in a different directory, they
38     # cannot use relative paths to find this file.
39     "src/crypto",
40   ]
42   if (cpu_arch == "x64") {
43     if (is_mac) {
44       sources += gypi_values.boringssl_mac_x86_64_sources
45     } else if (is_linux || is_android) {
46       sources += gypi_values.boringssl_linux_x86_64_sources
47     } else if (is_win) {
48       sources += gypi_values.boringssl_win_x86_64_sources
49     } else {
50       defines += [ "OPENSSL_NO_ASM" ]
51     }
52   } else if (cpu_arch == "x86") {
53     if (is_mac) {
54       sources += gypi_values.boringssl_mac_x86_sources
55     } else if (is_linux || is_android) {
56       sources += gypi_values.boringssl_linux_x86_sources
57     } else {
58       defines += [ "OPENSSL_NO_ASM" ]
59     }
60   } else if (cpu_arch == "arm") {
61     sources += gypi_values.boringssl_linux_arm_sources
62   } else {
63     defines += [ "OPENSSL_NO_ASM" ]
64   }
66   if (is_component_build) {
67     if (!is_win) {
68       configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
69     }
70     if (is_posix && !is_mac) {
71       # Avoid link failures on Linux x86-64.
72       # See http://rt.openssl.org/Ticket/Display.html?id=2466&user=guest&pass=guest
73       ldflags += [ "-Wl,-Bsymbolic" ]
74     }
75   }