DrMemory: Fix a typo in the End2EndTest name.
[chromium-blink-merge.git] / third_party / boringssl / BUILD.gn
bloba8fe16edb9056c11b4c8c21002d4273f8c1d416b
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") {
7   include_dirs = []
8   include_dirs += [ "src/include" ]
9   if (is_component_build) {
10     defines = [ "BORINGSSL_SHARED_LIBRARY" ]
11   }
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.
20 gypi_values =
21     exec_script("//build/gypi_to_gn.py",
22                 [ rebase_path("//third_party/boringssl/boringssl.gypi") ],
23                 "scope",
24                 [ "//third_party/boringssl/boringssl.gypi" ])
26 # Windows' assembly is built with Yasm. The other platforms use the platform
27 # assembler.
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
35     }
36   }
39 component("boringssl") {
40   sources = gypi_values.boringssl_crypto_sources
41   sources += gypi_values.boringssl_ssl_sources
43   public_configs = [ ":openssl_config" ]
45   cflags = []
46   defines = [
47     "BORINGSSL_IMPLEMENTATION",
48     "BORINGSSL_NO_STATIC_INITIALIZER",
49   ]
50   deps = []
51   if (is_component_build) {
52     defines += [ "BORINGSSL_SHARED_LIBRARY" ]
53   }
55   configs -= [ "//build/config/compiler:chromium_code" ]
56   configs += [
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",
62   ]
64   # Also gets the include dirs from :openssl_config
65   include_dirs = [
66     "src/include",
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.
71     "src/crypto",
72   ]
74   if (is_msan) {
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
81     } else if (is_win) {
82       deps += [ ":boringssl_asm" ]
83     } else {
84       defines += [ "OPENSSL_NO_ASM" ]
85     }
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
91     } else if (is_win) {
92       deps += [ ":boringssl_asm" ]
93     } else {
94       defines += [ "OPENSSL_NO_ASM" ]
95     }
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
100   } else {
101     defines += [ "OPENSSL_NO_ASM" ]
102   }