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) {
11 "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.
22 gypi_values = exec_script(
23 "//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
31 import("//third_party/yasm/yasm_assemble.gni")
32 yasm_assemble("boringssl_asm") {
33 if (cpu_arch == "x64") {
34 sources = gypi_values.boringssl_win_x86_64_sources
35 } else if (cpu_arch == "x86") {
36 sources = gypi_values.boringssl_win_x86_sources
41 component("boringssl") {
42 sources = gypi_values.boringssl_lib_sources
44 public_configs = [ ":openssl_config" ]
48 "BORINGSSL_IMPLEMENTATION",
49 "BORINGSSL_NO_STATIC_INITIALIZER",
51 if (is_component_build) {
53 "BORINGSSL_SHARED_LIBRARY",
57 configs -= [ "//build/config/compiler:chromium_code" ]
58 configs += [ "//build/config/compiler:no_chromium_code" ]
60 # Also gets the include dirs from :openssl_config
63 # This is for arm_arch.h, which is needed by some asm files. Since the
64 # asm files are generated and kept in a different directory, they
65 # cannot use relative paths to find this file.
70 # TODO(davidben): Fix size_t truncations in BoringSSL.
71 # https://crbug.com/429039
72 cflags += [ "/wd4267"]
75 if (cpu_arch == "x64") {
77 sources += gypi_values.boringssl_mac_x86_64_sources
78 } else if (is_linux || is_android) {
79 sources += gypi_values.boringssl_linux_x86_64_sources
81 deps += [ ":boringssl_asm" ]
83 defines += [ "OPENSSL_NO_ASM" ]
85 } else if (cpu_arch == "x86") {
87 sources += gypi_values.boringssl_mac_x86_sources
88 } else if (is_linux || is_android) {
89 sources += gypi_values.boringssl_linux_x86_sources
91 deps += [ ":boringssl_asm" ]
93 defines += [ "OPENSSL_NO_ASM" ]
95 } else if (cpu_arch == "arm") {
96 sources += gypi_values.boringssl_linux_arm_sources
98 defines += [ "OPENSSL_NO_ASM" ]