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 import("//build/config/sanitizers/sanitizers.gni")
7 # Config for us and everybody else depending on BoringSSL.
8 config("openssl_config") {
10 include_dirs += [ "src/include" ]
11 if (is_component_build) {
12 defines = [ "BORINGSSL_SHARED_LIBRARY" ]
16 # Config internal to this build file.
17 config("openssl_internal_config") {
18 visibility = [ ":*" ] # Only targets in this file can depend on this.
21 # The list of BoringSSL files is kept in boringssl.gypi.
23 exec_script("//build/gypi_to_gn.py",
24 [ rebase_path("//third_party/boringssl/boringssl.gypi") ],
26 [ "//third_party/boringssl/boringssl.gypi" ])
28 # Windows' assembly is built with Yasm. The other platforms use the platform
30 if (is_win && !is_msan) {
31 import("//third_party/yasm/yasm_assemble.gni")
32 yasm_assemble("boringssl_asm") {
33 if (current_cpu == "x64") {
34 sources = gypi_values.boringssl_win_x86_64_sources
35 } else if (current_cpu == "x86") {
36 sources = gypi_values.boringssl_win_x86_sources
41 component("boringssl") {
42 sources = gypi_values.boringssl_crypto_sources
43 sources += gypi_values.boringssl_ssl_sources
45 public_configs = [ ":openssl_config" ]
49 "BORINGSSL_IMPLEMENTATION",
50 "BORINGSSL_NO_STATIC_INITIALIZER",
53 if (is_component_build) {
54 defines += [ "BORINGSSL_SHARED_LIBRARY" ]
57 configs -= [ "//build/config/compiler:chromium_code" ]
59 "//build/config/compiler:no_chromium_code",
61 # TODO(davidben): Fix size_t truncations in BoringSSL.
62 # https://crbug.com/429039
63 "//build/config/compiler:no_size_t_to_int_warning",
66 # Also gets the include dirs from :openssl_config
67 include_dirs = [ "src/include" ]
70 defines += [ "OPENSSL_NO_ASM" ]
71 } else if (current_cpu == "x64") {
72 if (is_mac || is_ios) {
73 sources += gypi_values.boringssl_mac_x86_64_sources
74 } else if (is_linux || is_android) {
75 sources += gypi_values.boringssl_linux_x86_64_sources
77 deps += [ ":boringssl_asm" ]
79 defines += [ "OPENSSL_NO_ASM" ]
81 } else if (current_cpu == "x86") {
82 if (is_mac || is_ios) {
83 sources += gypi_values.boringssl_mac_x86_sources
84 } else if (is_linux || is_android) {
85 sources += gypi_values.boringssl_linux_x86_sources
87 deps += [ ":boringssl_asm" ]
89 defines += [ "OPENSSL_NO_ASM" ]
91 } else if (current_cpu == "arm" && (is_linux || is_android)) {
92 sources += gypi_values.boringssl_linux_arm_sources
93 } else if (current_cpu == "arm64" && (is_linux || is_android)) {
94 sources += gypi_values.boringssl_linux_aarch64_sources
96 defines += [ "OPENSSL_NO_ASM" ]
100 deps += [ "//native_client_sdk/src/libraries/nacl_io" ]