| # 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/assembly/bootfs_files_for_assembly.gni") | |
| import("//build/components.gni") | |
| import("//build/test.gni") | |
| fuchsia_component("cpp_crasher") { | |
| manifest = "meta/crasher.cml" | |
| deps = [ ":crasher_exe" ] | |
| } | |
| executable("crasher_exe") { | |
| visibility = [ ":*" ] | |
| output_name = "crasher" | |
| configs += [ "//build/config:all_source" ] | |
| sources = [ | |
| "cpp_specific.cc", | |
| "crasher.c", | |
| ] | |
| cflags = [ "-fstack-protector-all" ] | |
| deps = [ | |
| "//sdk/fidl/fuchsia.feedback:fuchsia.feedback_cpp", | |
| "//sdk/lib/async-loop:async-loop-cpp", | |
| "//sdk/lib/async-loop:async-loop-default", | |
| "//sdk/lib/fdio", | |
| "//sdk/lib/syslog/cpp", | |
| "//src/zircon/lib/zircon", | |
| ] | |
| # TODO(https://fxbug.dev/42176699): This target uses mutable tables which are deprecated, | |
| # rather than builders. | |
| configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ] | |
| } | |
| bootfs_files_for_assembly("bootfs") { | |
| deps = [ ":crasher_exe" ] | |
| } | |
| fuchsia_unittest_component("cpp_crasher_test") { | |
| deps = [ ":crasher_test" ] | |
| } | |
| test("crasher_test") { | |
| sources = [ "crasher_test.cc" ] | |
| deps = [ | |
| "//src/lib/fxl/test:gtest_main", | |
| "//third_party/googletest:gtest", | |
| ] | |
| } | |
| # Because the test package is declared in another file. | |
| fuchsia_test("tests") { | |
| package = "..:crasher_test" | |
| component = ":cpp_crasher_test" | |
| environments = [] # don't run it on any bots | |
| } |