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
65 include_dirs = [ "src/include" ]
68 defines += [ "OPENSSL_NO_ASM" ]
69 } else if (current_cpu == "x64") {
70 if (is_mac || is_ios) {
71 sources += gypi_values.boringssl_mac_x86_64_sources
72 } else if (is_linux || is_android) {
73 sources += gypi_values.boringssl_linux_x86_64_sources
75 deps += [ ":boringssl_asm" ]
77 defines += [ "OPENSSL_NO_ASM" ]
79 } else if (current_cpu == "x86") {
80 if (is_mac || is_ios) {
81 sources += gypi_values.boringssl_mac_x86_sources
82 } else if (is_linux || is_android) {
83 sources += gypi_values.boringssl_linux_x86_sources
85 deps += [ ":boringssl_asm" ]
87 defines += [ "OPENSSL_NO_ASM" ]
89 } else if (current_cpu == "arm" && (is_linux || is_android)) {
90 sources += gypi_values.boringssl_linux_arm_sources
91 } else if (current_cpu == "arm64" && (is_linux || is_android)) {
92 sources += gypi_values.boringssl_linux_aarch64_sources
94 defines += [ "OPENSSL_NO_ASM" ]