| # Copyright 2018 The Fuchsia Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| import("//build/fuzzing/fuchsia_library_fuzzer.gni") | |
| import("//build/fuzzing/host_library_fuzzer.gni") | |
| # Creates a C++ fuzzer binary. | |
| # | |
| # This template can be used to create fuzzers for both the Fuchsia and | |
| # development host platforms. | |
| # | |
| # Parameters are the same as `executable`, plus: | |
| # | |
| # test_inputs | |
| # Same meaning as for `host_library_fuzzer` when building for host, ignored otherwise. | |
| # | |
| template("cpp_fuzzer") { | |
| ignored_parameters = [] | |
| if (is_fuchsia) { | |
| ignored_parameters += [ "test_inputs" ] | |
| fuchsia_library_fuzzer(target_name) { | |
| forward_variables_from(invoker, "*", ignored_parameters) | |
| } | |
| } else { | |
| host_library_fuzzer(target_name) { | |
| forward_variables_from(invoker, "*", ignored_parameters) | |
| } | |
| } | |
| not_needed(invoker, ignored_parameters) | |
| } | |
| set_defaults("cpp_fuzzer") { | |
| configs = default_executable_configs | |
| } |