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" ]
9 if (is_component_build) {
10 defines = [ "BORINGSSL_SHARED_LIBRARY" ]
14 # Config internal to this build file.
15 config("openssl_internal_config") {
16 visibility = [ ":*" ] # Only targets in this file can depend on this.
19 # The list of BoringSSL files is kept in boringssl.gypi.
21 exec_script("//build/gypi_to_gn.py",
22 [ rebase_path("//third_party/boringssl/boringssl.gypi") ],
24 [ "//third_party/boringssl/boringssl.gypi" ])
26 # Windows' assembly is built with Yasm. The other platforms use the platform
29 import("//third_party/yasm/yasm_assemble.gni")
30 yasm_assemble("boringssl_asm") {
31 if (current_cpu == "x64") {
32 sources = gypi_values.boringssl_win_x86_64_sources
33 } else if (current_cpu == "x86") {
34 sources = gypi_values.boringssl_win_x86_sources
39 component("boringssl") {
40 sources = gypi_values.boringssl_lib_sources
42 public_configs = [ ":openssl_config" ]
46 "BORINGSSL_IMPLEMENTATION",
47 "BORINGSSL_NO_STATIC_INITIALIZER",
50 if (is_component_build) {
51 defines += [ "BORINGSSL_SHARED_LIBRARY" ]
54 configs -= [ "//build/config/compiler:chromium_code" ]
56 "//build/config/compiler:no_chromium_code",
58 # TODO(davidben): Fix size_t truncations in BoringSSL.
59 # https://crbug.com/429039
60 "//build/config/compiler:no_size_t_to_int_warning",
63 # Also gets the include dirs from :openssl_config
67 # This is for arm_arch.h, which is needed by some asm files. Since the
68 # asm files are generated and kept in a different directory, they
69 # cannot use relative paths to find this file.
73 if (current_cpu == "x64") {
75 sources += gypi_values.boringssl_mac_x86_64_sources
76 } else if (is_linux || is_android) {
77 sources += gypi_values.boringssl_linux_x86_64_sources
79 deps += [ ":boringssl_asm" ]
81 defines += [ "OPENSSL_NO_ASM" ]
83 } else if (current_cpu == "x86") {
85 sources += gypi_values.boringssl_mac_x86_sources
86 } else if (is_linux || is_android) {
87 sources += gypi_values.boringssl_linux_x86_sources
89 deps += [ ":boringssl_asm" ]
91 defines += [ "OPENSSL_NO_ASM" ]
93 } else if (current_cpu == "arm") {
94 sources += gypi_values.boringssl_linux_arm_sources
95 } else if (current_cpu == "arm64") {
96 sources += gypi_values.boringssl_linux_aarch64_sources
98 defines += [ "OPENSSL_NO_ASM" ]