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 # Win32's assembly is built by Yasm. The other ports use the platform assembler.
29 if (cpu_arch == "x86" && is_win) {
30 import("//third_party/yasm/yasm_assemble.gni")
31 yasm_assemble("boringssl_asm") {
32 sources = gypi_values.boringssl_win_x86_sources
36 component("boringssl") {
37 sources = gypi_values.boringssl_lib_sources
39 public_configs = [ ":openssl_config" ]
43 "BORINGSSL_IMPLEMENTATION",
44 "BORINGSSL_NO_STATIC_INITIALIZER",
46 if (is_component_build) {
48 "BORINGSSL_SHARED_LIBRARY",
52 configs -= [ "//build/config/compiler:chromium_code" ]
53 configs += [ "//build/config/compiler:no_chromium_code" ]
55 # Also gets the include dirs from :openssl_config
58 # This is for arm_arch.h, which is needed by some asm files. Since the
59 # asm files are generated and kept in a different directory, they
60 # cannot use relative paths to find this file.
65 # TODO(davidben): Fix size_t truncations in BoringSSL.
66 # https://crbug.com/429039
67 cflags += [ "/wd4267"]
70 if (cpu_arch == "x64") {
72 sources += gypi_values.boringssl_mac_x86_64_sources
73 } else if (is_linux || is_android) {
74 sources += gypi_values.boringssl_linux_x86_64_sources
76 sources += gypi_values.boringssl_win_x86_64_sources
78 defines += [ "OPENSSL_NO_ASM" ]
80 } else if (cpu_arch == "x86") {
82 sources += gypi_values.boringssl_mac_x86_sources
83 } else if (is_linux || is_android) {
84 sources += gypi_values.boringssl_linux_x86_sources
86 deps += [ ":boringssl_asm" ]
88 defines += [ "OPENSSL_NO_ASM" ]
90 } else if (cpu_arch == "arm") {
91 sources += gypi_values.boringssl_linux_arm_sources
93 defines += [ "OPENSSL_NO_ASM" ]