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") {
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") ],
21 [ "//third_party/boringssl/boringssl.gypi" ])
23 component("boringssl") {
24 sources = gypi_values.boringssl_lib_sources
26 direct_dependent_configs = [ ":openssl_config" ]
30 configs -= [ "//build/config/compiler:chromium_code" ]
31 configs += [ "//build/config/compiler:no_chromium_code" ]
33 # Also gets the include dirs from :openssl_config
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.
42 if (cpu_arch == "x64") {
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
48 sources += gypi_values.boringssl_win_x86_64_sources
50 defines += [ "OPENSSL_NO_ASM" ]
52 } else if (cpu_arch == "x86") {
54 sources += gypi_values.boringssl_mac_x86_sources
55 } else if (is_linux || is_android) {
56 sources += gypi_values.boringssl_linux_x86_sources
58 defines += [ "OPENSSL_NO_ASM" ]
60 } else if (cpu_arch == "arm") {
61 sources += gypi_values.boringssl_linux_arm_sources
63 defines += [ "OPENSSL_NO_ASM" ]
66 if (is_component_build) {
68 configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
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" ]