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
28 if (is_win && !is_msan) {
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_crypto_sources
41 sources += gypi_values.boringssl_ssl_sources
43 public_configs = [ ":openssl_config" ]
47 "BORINGSSL_IMPLEMENTATION",
48 "BORINGSSL_NO_STATIC_INITIALIZER",
51 if (is_component_build) {
52 defines += [ "BORINGSSL_SHARED_LIBRARY" ]
55 configs -= [ "//build/config/compiler:chromium_code" ]
57 "//build/config/compiler:no_chromium_code",
59 # TODO(davidben): Fix size_t truncations in BoringSSL.
60 # https://crbug.com/429039
61 "//build/config/compiler:no_size_t_to_int_warning",
64 # Also gets the include dirs from :openssl_config
68 # This is for arm_arch.h, which is needed by some asm files. Since the
69 # asm files are generated and kept in a different directory, they
70 # cannot use relative paths to find this file.
75 defines += [ "OPENSSL_NO_ASM" ]
76 } else if (current_cpu == "x64") {
77 if (is_mac || is_ios) {
78 sources += gypi_values.boringssl_mac_x86_64_sources
79 } else if (is_linux || is_android) {
80 sources += gypi_values.boringssl_linux_x86_64_sources
82 deps += [ ":boringssl_asm" ]
84 defines += [ "OPENSSL_NO_ASM" ]
86 } else if (current_cpu == "x86") {
87 if (is_mac || is_ios) {
88 sources += gypi_values.boringssl_mac_x86_sources
89 } else if (is_linux || is_android) {
90 sources += gypi_values.boringssl_linux_x86_sources
92 deps += [ ":boringssl_asm" ]
94 defines += [ "OPENSSL_NO_ASM" ]
96 } else if (current_cpu == "arm" && (is_linux || is_android)) {
97 sources += gypi_values.boringssl_linux_arm_sources
98 } else if (current_cpu == "arm64" && (is_linux || is_android)) {
99 sources += gypi_values.boringssl_linux_aarch64_sources
101 defines += [ "OPENSSL_NO_ASM" ]