blob: f1fc7eb27b4fd9ff633311ad217f1692b209cd10 [file] [log] [blame]
# 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/fidl/fidl.gni")
import("//third_party/protobuf/proto_library.gni")
if (is_host) {
static_library("host_lib") {
public = [
"analytics.h",
"code_generator/code_generator.h",
"code_generator/cpp_visitor.h",
"code_generator/test_generator.h",
"comparator.h",
"decoder.h",
"event.h",
"exception_decoder.h",
"fidlcat_printer.h",
"inference.h",
"interception_workflow.h",
"replay.h",
"statistics.h",
"syscall_decoder.h",
"syscall_decoder_dispatcher.h",
"syscall_decoder_interface.h",
"top.h",
"type_decoder.h",
]
sources = [
"code_generator/code_generator.cc",
"code_generator/cpp_visitor.cc",
"code_generator/test_generator.cc",
"comparator.cc",
"decoder.cc",
"event.cc",
"exception_decoder.cc",
"fidlcat_printer.cc",
"inference.cc",
"interception_workflow.cc",
"replay.cc",
"statistics.cc",
"syscall_decoder.cc",
"syscall_decoder_dispatcher.cc",
"syscall_decoder_interface.cc",
"syscall_definition.cc",
"top.cc",
"type_decoder.cc",
]
deps = [
":session_proto",
"//sdk/lib/fit",
"//src/developer/debug/ipc:client",
"//src/developer/debug/zxdb/client",
"//src/developer/debug/zxdb/common",
"//src/lib/analytics/cpp/core_dev_tools",
"//src/lib/fidl_codec",
"//src/lib/fidl_codec:value_proto",
"//src/lib/fxl",
"//third_party/protobuf:protobuf_full",
"//third_party/rapidjson",
"//zircon/system/ulib/fidl:fidl_base",
]
public_deps = [
"//third_party/re2",
"//tools/fidlcat:lib",
"//zircon/system/public",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
source_set("host_tests") {
testonly = true
sources = [
"code_generator/code_generator_test.cc",
"code_generator/cpp_visitor_test.cc",
"comparator_test.cc",
]
deps = [
":host_lib",
"//src/developer/debug/zxdb/client",
"//src/lib/fidl_codec",
"//third_party/googletest:gtest",
"//third_party/protobuf:protobuf_full",
"//third_party/rapidjson",
"//zircon/system/ulib/fidl:fidl_base",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
proto_library("session_proto") {
proto_in_dir = "//"
sources = [ "//tools/fidlcat/proto/session.proto" ]
generate_python = false
deps = [
"//src/lib/fidl_codec:value_proto",
"//third_party/protobuf:protobuf_full",
]
}
}
action("json_for_test") {
deps = [
":fidl($fidl_toolchain)",
":fidl-composed($fidl_toolchain)",
":fidl-sys($fidl_toolchain)",
"//sdk/fidl/fuchsia.io",
"//sdk/fidl/fuchsia.sys",
"//sdk/lib/fidl/cpp/test:frobinator",
]
outputs = [ "$target_gen_dir/library_loader_test_data.h" ]
script = "generate_test_includes.sh"
args = [
rebase_path(outputs[0], root_build_dir),
"fidling/gen/sdk/lib/fidl/cpp/test/frobinator.fidl.json",
"fidling/gen/zircon/system/fidl/fuchsia-io/fuchsia-io.fidl.json",
"fidling/gen/tools/fidlcat/lib/fidl.fidl.json",
"fidling/gen/tools/fidlcat/lib/fidl-composed.fidl.json",
"fidling/gen/tools/fidlcat/lib/fidl-sys.fidl.json",
]
}
fidl("fidl") {
name = "test.fidlcat.examples"
sources = [
"testdata/empty.test.fidl",
"testdata/types.test.fidl",
]
}
fidl("fidl-composed") {
name = "test.fidlcat.composedinto"
sources = [ "testdata/composed_into.test.fidl" ]
public_deps = [ ":fidl" ]
}
fidl("fidl-sys") {
name = "test.fidlcat.sys"
sources = [ "testdata/sys.test.fidl" ]
}