| # Copyright 2019 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/cpp/sdk_executable.gni") |
| import("//build/host.gni") |
| import("//build/test.gni") |
| |
| if (current_toolchain == host_toolchain) { |
| sdk_executable("bin") { |
| category = "partner" |
| |
| output_name = "kazoo" |
| |
| sources = [ |
| "main.cc", |
| ] |
| deps = [ |
| ":lib", |
| "//zircon/public/lib/cmdline", |
| ] |
| } |
| |
| static_library("lib") { |
| sources = [ |
| "asm_output.cc", |
| "category_output.cc", |
| "kernel_branches_output.cc", |
| "ktrace_output.cc", |
| "output_util.cc", |
| "output_util.h", |
| "outputs.h", |
| "syscall_library.cc", |
| "syscall_library.h", |
| "syscall_numbers_output.cc", |
| "writer.cc", |
| "writer.h", |
| ] |
| |
| deps = [ |
| "//src/lib/files", |
| "//zircon/public/lib/fbl", |
| ] |
| public_deps = [ |
| "//src/lib/fxl", |
| "//third_party/rapidjson", |
| ] |
| } |
| |
| test("kazoo_host_tests") { |
| deps = [ |
| ":generate_test_files", |
| ":lib", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| ] |
| |
| include_dirs = [ "$target_gen_dir" ] |
| |
| sources = [ |
| "asm_output_test.cc", |
| "category_output_test.cc", |
| "kernel_branches_output_test.cc", |
| "ktrace_output_test.cc", |
| "output_util_test.cc", |
| "syscall_library_test.cc", |
| "syscall_numbers_output_test.cc", |
| "writer_test.cc", |
| ] |
| } |
| |
| compiled_action_foreach("test_files_fidl_to_json") { |
| tool = "//zircon/public/tool/fidlc" |
| |
| args = [ |
| "--json", |
| rebase_path("$target_gen_dir") + "/{{source_name_part}}.json", |
| "--files", |
| "{{source}}", |
| ] |
| |
| outputs = [ |
| "$target_gen_dir/{{source_name_part}}.json", |
| ] |
| |
| sources = [ |
| "test_no_methods.test.fidl", |
| "test_one_protocol_one_method.test.fidl", |
| "test_one_protocol_two_methods.test.fidl", |
| "test_one_protocol_two_methods_with_internal.test.fidl", |
| "test_various_categories.test.fidl", |
| ] |
| } |
| |
| action_foreach("generate_test_files") { |
| script = "fidl_to_h.py" |
| |
| deps = [ |
| ":test_files_fidl_to_json", |
| ] |
| |
| args = [ |
| "{{source}}", |
| rebase_path("$target_gen_dir") + "/test_ir_{{source_name_part}}.h", |
| "{{source_name_part}}", |
| ] |
| |
| outputs = [ |
| "$target_gen_dir/test_ir_{{source_name_part}}.h", |
| ] |
| |
| sources = get_target_outputs(":test_files_fidl_to_json") |
| } |
| } |
| |
| install_host_tools("kazoo_host") { |
| deps = [ |
| ":bin", |
| ] |
| outputs = [ |
| "kazoo", |
| ] |
| } |