Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: third_party/boringssl/BUILD.gn

Issue 779473002: gn format //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/android_protobuf/BUILD.gn ('k') | third_party/brotli/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # Config for us and everybody else depending on BoringSSL. 5 # Config for us and everybody else depending on BoringSSL.
6 config("openssl_config") { 6 config("openssl_config") {
7 include_dirs = [] 7 include_dirs = []
8 include_dirs += [ "src/include" ] 8 include_dirs += [ "src/include" ]
9 if (is_component_build) { 9 if (is_component_build) {
10 defines = [ 10 defines = [ "BORINGSSL_SHARED_LIBRARY" ]
11 "BORINGSSL_SHARED_LIBRARY",
12 ]
13 } 11 }
14 } 12 }
15 13
16 # Config internal to this build file. 14 # Config internal to this build file.
17 config("openssl_internal_config") { 15 config("openssl_internal_config") {
18 visibility = [ ":*" ] # Only targets in this file can depend on this. 16 visibility = [ ":*" ] # Only targets in this file can depend on this.
19 } 17 }
20 18
21 # The list of BoringSSL files is kept in boringssl.gypi. 19 # The list of BoringSSL files is kept in boringssl.gypi.
22 gypi_values = exec_script( 20 gypi_values =
23 "//build/gypi_to_gn.py", 21 exec_script("//build/gypi_to_gn.py",
24 [ rebase_path("//third_party/boringssl/boringssl.gypi") ], 22 [ rebase_path("//third_party/boringssl/boringssl.gypi") ],
25 "scope", 23 "scope",
26 [ "//third_party/boringssl/boringssl.gypi" ]) 24 [ "//third_party/boringssl/boringssl.gypi" ])
27 25
28 # Windows' assembly is built with Yasm. The other platforms use the platform 26 # Windows' assembly is built with Yasm. The other platforms use the platform
29 # assembler. 27 # assembler.
30 if (is_win) { 28 if (is_win) {
31 import("//third_party/yasm/yasm_assemble.gni") 29 import("//third_party/yasm/yasm_assemble.gni")
32 yasm_assemble("boringssl_asm") { 30 yasm_assemble("boringssl_asm") {
33 if (cpu_arch == "x64") { 31 if (cpu_arch == "x64") {
34 sources = gypi_values.boringssl_win_x86_64_sources 32 sources = gypi_values.boringssl_win_x86_64_sources
35 } else if (cpu_arch == "x86") { 33 } else if (cpu_arch == "x86") {
36 sources = gypi_values.boringssl_win_x86_sources 34 sources = gypi_values.boringssl_win_x86_sources
37 } 35 }
38 } 36 }
39 } 37 }
40 38
41 component("boringssl") { 39 component("boringssl") {
42 sources = gypi_values.boringssl_lib_sources 40 sources = gypi_values.boringssl_lib_sources
43 41
44 public_configs = [ ":openssl_config" ] 42 public_configs = [ ":openssl_config" ]
45 43
46 cflags = [] 44 cflags = []
47 defines = [ 45 defines = [
48 "BORINGSSL_IMPLEMENTATION", 46 "BORINGSSL_IMPLEMENTATION",
49 "BORINGSSL_NO_STATIC_INITIALIZER", 47 "BORINGSSL_NO_STATIC_INITIALIZER",
50 ] 48 ]
51 if (is_component_build) { 49 if (is_component_build) {
52 defines += [ 50 defines += [ "BORINGSSL_SHARED_LIBRARY" ]
53 "BORINGSSL_SHARED_LIBRARY",
54 ]
55 } 51 }
56 52
57 configs -= [ "//build/config/compiler:chromium_code" ] 53 configs -= [ "//build/config/compiler:chromium_code" ]
58 configs += [ "//build/config/compiler:no_chromium_code" ] 54 configs += [ "//build/config/compiler:no_chromium_code" ]
59 55
60 # Also gets the include dirs from :openssl_config 56 # Also gets the include dirs from :openssl_config
61 include_dirs = [ 57 include_dirs = [
62 "src/include", 58 "src/include",
59
63 # This is for arm_arch.h, which is needed by some asm files. Since the 60 # 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 61 # asm files are generated and kept in a different directory, they
65 # cannot use relative paths to find this file. 62 # cannot use relative paths to find this file.
66 "src/crypto", 63 "src/crypto",
67 ] 64 ]
68 65
69 if (is_win) { 66 if (is_win) {
70 # TODO(davidben): Fix size_t truncations in BoringSSL. 67 # TODO(davidben): Fix size_t truncations in BoringSSL.
71 # https://crbug.com/429039 68 # https://crbug.com/429039
72 cflags += [ "/wd4267"] 69 cflags += [ "/wd4267" ]
73 } 70 }
74 71
75 if (cpu_arch == "x64") { 72 if (cpu_arch == "x64") {
76 if (is_mac) { 73 if (is_mac) {
77 sources += gypi_values.boringssl_mac_x86_64_sources 74 sources += gypi_values.boringssl_mac_x86_64_sources
78 } else if (is_linux || is_android) { 75 } else if (is_linux || is_android) {
79 sources += gypi_values.boringssl_linux_x86_64_sources 76 sources += gypi_values.boringssl_linux_x86_64_sources
80 } else if (is_win) { 77 } else if (is_win) {
81 deps += [ ":boringssl_asm" ] 78 deps += [ ":boringssl_asm" ]
82 } else { 79 } else {
83 defines += [ "OPENSSL_NO_ASM" ] 80 defines += [ "OPENSSL_NO_ASM" ]
84 } 81 }
85 } else if (cpu_arch == "x86") { 82 } else if (cpu_arch == "x86") {
86 if (is_mac) { 83 if (is_mac) {
87 sources += gypi_values.boringssl_mac_x86_sources 84 sources += gypi_values.boringssl_mac_x86_sources
88 } else if (is_linux || is_android) { 85 } else if (is_linux || is_android) {
89 sources += gypi_values.boringssl_linux_x86_sources 86 sources += gypi_values.boringssl_linux_x86_sources
90 } else if (is_win) { 87 } else if (is_win) {
91 deps += [ ":boringssl_asm" ] 88 deps += [ ":boringssl_asm" ]
92 } else { 89 } else {
93 defines += [ "OPENSSL_NO_ASM" ] 90 defines += [ "OPENSSL_NO_ASM" ]
94 } 91 }
95 } else if (cpu_arch == "arm") { 92 } else if (cpu_arch == "arm") {
96 sources += gypi_values.boringssl_linux_arm_sources 93 sources += gypi_values.boringssl_linux_arm_sources
97 } else { 94 } else {
98 defines += [ "OPENSSL_NO_ASM" ] 95 defines += [ "OPENSSL_NO_ASM" ]
99 } 96 }
100 } 97 }
OLDNEW
« no previous file with comments | « third_party/android_protobuf/BUILD.gn ('k') | third_party/brotli/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698