|
2 | 2 | # Use of this source code is governed by a BSD-style license that can be |
3 | 3 | # found in the LICENSE file. |
4 | 4 |
|
5 | | -import("//build/config/android/config.gni") |
6 | | -import("//build/config/arm.gni") |
7 | | -import("//build/config/compiler/compiler.gni") |
8 | | -import("//build/config/sanitizers/sanitizers.gni") |
9 | | -import("//build_overrides/build.gni") |
10 | | -import("src/gen/sources.gni") |
11 | | - |
12 | | -# Config for us and everybody else depending on BoringSSL. |
13 | | -config("external_config") { |
14 | | - include_dirs = [ "src/include" ] |
15 | | - if (is_component_build) { |
16 | | - defines = [ "BORINGSSL_SHARED_LIBRARY" ] |
17 | | - } |
18 | | -} |
19 | | - |
20 | | -# The config used by the :boringssl component itself, and the fuzzer copies. |
21 | | -config("component_config") { |
22 | | - visibility = [ ":*" ] |
23 | | - configs = [ ":internal_config" ] |
24 | | - defines = [ "BORINGSSL_IMPLEMENTATION" ] |
25 | | - |
| 5 | +config("boringssl_config") { |
26 | 6 | cflags_c = [ "-std=c17" ] |
27 | 7 | } |
28 | 8 |
|
29 | | -# This config is used by anything that consumes internal headers. Tests consume |
30 | | -# this rather than :component_config. |
31 | | -config("internal_config") { |
32 | | - visibility = [ ":*" ] |
33 | | - defines = [ |
34 | | - "OPENSSL_SMALL", |
35 | | - "OPENSSL_STATIC_ARMCAP", |
36 | | - ] |
37 | | - if (is_posix) { |
38 | | - defines += [ "_XOPEN_SOURCE=700" ] |
39 | | - } |
40 | | -} |
41 | | - |
42 | | -config("no_asm_config") { |
43 | | - visibility = [ ":*" ] |
44 | | - defines = [ "OPENSSL_NO_ASM" ] |
45 | | -} |
46 | | - |
47 | | -# TODO(crbug.com/42290535): Move Chromium's use of libpki to the public API and |
48 | | -# unexport pki_internal_headers. |
49 | | -all_sources = bcm_internal_headers + bcm_sources + crypto_internal_headers + |
50 | | - crypto_sources + ssl_internal_headers + ssl_sources + pki_sources |
51 | | -all_headers = crypto_headers + ssl_headers + pki_headers + pki_internal_headers |
52 | | - |
53 | | -if (is_msan) { |
54 | | - # MSan instrumentation is incompatible with assembly optimizations. |
55 | | - # BoringSSL's GAS-compatible assembly knows how to detect MSan, but the NASM |
56 | | - # assembly does not, so we check for MSan explicitly. |
57 | | - source_set("boringssl_asm") { |
58 | | - visibility = [ ":*" ] |
59 | | - public_configs = [ ":no_asm_config" ] |
60 | | - } |
61 | | -} else if (is_win && (current_cpu == "x86" || current_cpu == "x64")) { |
62 | | - # Windows' x86 and x86_64 assembly is built with NASM. |
63 | | - source_set("boringssl_asm") { |
64 | | - visibility = [ ":*" ] |
65 | | - public_configs = [ ":no_asm_config" ] |
66 | | - } |
67 | | -} else { |
68 | | - # All other targets use GAS-compatible assembler. BoringSSL's assembly files |
69 | | - # are all wrapped in processor checks for the corresponding target, so there |
70 | | - # is no need to add target conditions in the build. |
71 | | - source_set("boringssl_asm") { |
72 | | - visibility = [ ":*" ] |
73 | | - sources = rebase_path(bcm_sources_asm + crypto_sources_asm, ".", "src") |
74 | | - include_dirs = [ "src/include" ] |
75 | | - } |
76 | | -} |
77 | | - |
78 | 9 | source_set("boringssl") { |
79 | | - sources = rebase_path(all_sources, ".", "src") |
80 | | - public = rebase_path(all_headers, ".", "src") |
81 | | - |
82 | | - if (is_win) { |
83 | | - configs += [ ":no_asm_config" ] |
84 | | - } else { |
85 | | - deps = [ ":boringssl_asm" ] |
86 | | - } |
87 | | - |
88 | | - public_configs = [ ":external_config" ] |
89 | | - configs += [ ":component_config" ] |
| 10 | + configs += [ ":boringssl_config" ] |
90 | 11 |
|
91 | | - configs -= [ "//build/config/compiler:chromium_code" ] |
92 | | - configs += [ "//build/config/compiler:no_chromium_code" ] |
| 12 | + deps = [ "//flutter/third_party/dart/third_party/boringssl:boringssl" ] |
93 | 13 | } |
0 commit comments