OLD | NEW |
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 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
| 7 import("//build_overrides/build.gni") |
7 import("//testing/libfuzzer/fuzzer_test.gni") | 8 import("//testing/libfuzzer/fuzzer_test.gni") |
8 import("BUILD.generated.gni") | 9 import("BUILD.generated.gni") |
9 import("BUILD.generated_tests.gni") | 10 import("BUILD.generated_tests.gni") |
10 | 11 |
11 # Config for us and everybody else depending on BoringSSL. | 12 # Config for us and everybody else depending on BoringSSL. |
12 config("external_config") { | 13 config("external_config") { |
13 include_dirs = [ "src/include" ] | 14 include_dirs = [ "src/include" ] |
14 if (is_component_build) { | 15 if (is_component_build) { |
15 defines = [ "BORINGSSL_SHARED_LIBRARY" ] | 16 defines = [ "BORINGSSL_SHARED_LIBRARY" ] |
16 } | 17 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 125 } |
125 } | 126 } |
126 | 127 |
127 create_tests("boringssl_tests") { | 128 create_tests("boringssl_tests") { |
128 configs = [ ":internal_config" ] | 129 configs = [ ":internal_config" ] |
129 deps = [ | 130 deps = [ |
130 ":boringssl", | 131 ":boringssl", |
131 ] | 132 ] |
132 } | 133 } |
133 | 134 |
134 test("boringssl_unittests") { | 135 if (build_with_chromium) { |
135 deps = [ | 136 test("boringssl_unittests") { |
136 ":boringssl_tests", | 137 deps = [ |
137 "//base", | 138 ":boringssl_tests", |
138 "//base/test:run_all_unittests", | 139 "//base", |
139 "//base/test:test_support", | 140 "//base/test:run_all_unittests", |
140 "//testing/gtest", | 141 "//base/test:test_support", |
141 ] | 142 "//testing/gtest", |
142 sources = [ | 143 ] |
143 "boringssl_unittest.cc", | 144 sources = [ |
144 ] | 145 "boringssl_unittest.cc", |
145 } | 146 ] |
| 147 } |
146 | 148 |
147 # The same as boringssl, but builds with BORINGSSL_UNSAFE_FUZZER_MODE. | 149 # The same as boringssl, but builds with BORINGSSL_UNSAFE_FUZZER_MODE. |
148 component("boringssl_fuzzer") { | 150 component("boringssl_fuzzer") { |
149 visibility = [ ":*" ] # Only targets in this file can depend on this. | 151 visibility = [ ":*" ] # Only targets in this file can depend on this. |
150 | 152 |
151 sources = all_sources | 153 sources = all_sources |
152 deps = [ | 154 deps = [ |
153 ":boringssl_asm", | 155 ":boringssl_asm", |
154 ] | 156 ] |
155 | 157 |
156 public_configs = [ | 158 public_configs = [ |
157 ":external_config", | 159 ":external_config", |
158 ":fuzzer_config", | 160 ":fuzzer_config", |
159 ] | 161 ] |
160 configs += [ ":internal_config" ] | 162 configs += [ ":internal_config" ] |
161 | 163 |
162 configs -= [ "//build/config/compiler:chromium_code" ] | 164 configs -= [ "//build/config/compiler:chromium_code" ] |
163 configs += [ "//build/config/compiler:no_chromium_code" ] | 165 configs += [ "//build/config/compiler:no_chromium_code" ] |
164 | 166 |
165 if (is_nacl) { | 167 if (is_nacl) { |
166 deps += [ "//native_client_sdk/src/libraries/nacl_io" ] | 168 deps += [ "//native_client_sdk/src/libraries/nacl_io" ] |
| 169 } |
| 170 } |
| 171 |
| 172 foreach(fuzzer, fuzzers) { |
| 173 fuzzer_test("boringssl_${fuzzer}_fuzzer") { |
| 174 sources = [ |
| 175 "src/fuzz/${fuzzer}.cc", |
| 176 ] |
| 177 deps = [ |
| 178 ":boringssl_fuzzer", |
| 179 ] |
| 180 seed_corpus = "src/fuzz/${fuzzer}_corpus" |
| 181 } |
167 } | 182 } |
168 } | 183 } |
169 | |
170 foreach(fuzzer, fuzzers) { | |
171 fuzzer_test("boringssl_${fuzzer}_fuzzer") { | |
172 sources = [ | |
173 "src/fuzz/${fuzzer}.cc", | |
174 ] | |
175 deps = [ | |
176 ":boringssl_fuzzer", | |
177 ] | |
178 seed_corpus = "src/fuzz/${fuzzer}_corpus" | |
179 } | |
180 } | |
OLD | NEW |