| # 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. |
| |
| ########################################## |
| # Though under //zircon, this build file # |
| # is meant to be used in the Fuchsia GN # |
| # build. # |
| # See fxb/36139. # |
| ########################################## |
| |
| assert(!defined(zx) || zx != "/", |
| "This file can only be used in the Fuchsia GN build.") |
| |
| import("//build/test.gni") |
| import("//build/unification/images/migrated_manifest.gni") |
| import("//build/unification/zx_library.gni") |
| |
| zx_library("crashsvc") { |
| sdk = "source" |
| |
| sdk_headers = [ "crashsvc/crashsvc.h" ] |
| |
| sources = [ "crashsvc.cc" ] |
| |
| deps = [ |
| "//zircon/public/lib/backtrace-request-utils", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/inspector", |
| "//zircon/system/fidl/fuchsia-exception:llcpp", |
| ] |
| |
| public_deps = [ "//zircon/public/lib/zx" ] |
| |
| defines = [ "_ALL_SOURCE" ] |
| } |
| |
| executable("svchost") { |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| sources = [ |
| "svchost.cc", |
| "sysmem.cc", |
| ] |
| deps = [ |
| ":crashsvc", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/fs", |
| "//zircon/public/lib/kcounter", |
| "//zircon/public/lib/kernel-debug", |
| "//zircon/public/lib/kernel-mexec", |
| "//zircon/public/lib/logger", |
| "//zircon/public/lib/profile", |
| "//zircon/public/lib/svc", |
| "//zircon/public/lib/sysmem-connector", |
| "//zircon/system/fidl/fuchsia-boot:c", |
| "//zircon/system/fidl/fuchsia-device:c", |
| "//zircon/system/fidl/fuchsia-device:llcpp", |
| "//zircon/system/fidl/fuchsia-device-manager:c", |
| "//zircon/system/fidl/fuchsia-fshost:c", |
| "//zircon/system/fidl/fuchsia-hardware-power-statecontrol:c", |
| "//zircon/system/fidl/fuchsia-hardware-pty:c", |
| "//zircon/system/fidl/fuchsia-io:c", |
| "//zircon/system/fidl/fuchsia-kernel:c", |
| "//zircon/system/fidl/fuchsia-logger:c", |
| "//zircon/system/fidl/fuchsia-mem:c", |
| "//zircon/system/fidl/fuchsia-net:llcpp", |
| "//zircon/system/fidl/fuchsia-paver:c", |
| "//zircon/system/fidl/fuchsia-posix-socket:llcpp", |
| "//zircon/system/fidl/fuchsia-process:c", |
| "//zircon/system/fidl/fuchsia-scheduler:c", |
| "//zircon/system/fidl/fuchsia-sysinfo:c", |
| "//zircon/system/fidl/fuchsia-sysmem:c", |
| "//zircon/system/fidl/fuchsia-virtualconsole:c", |
| ] |
| output_dir = "$root_out_dir/zircon-migrated" |
| } |
| |
| test("crashsvc-test") { |
| # Dependent manifests unfortunately cannot be marked as `testonly`. |
| # TODO(44278): Remove when converting this file to proper GN build idioms. |
| if (is_fuchsia) { |
| testonly = false |
| } |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| output_name = "crashsvc-test" |
| sources = [ "crashsvc-test.cc" ] |
| deps = [ |
| ":crashsvc", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/fidl-async-cpp", |
| "//zircon/public/lib/fs", |
| "//zircon/public/lib/mini-process", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/fidl/fuchsia-exception:llcpp", |
| ] |
| } |
| |
| migrated_manifest("svchost-manifest") { |
| deps = [ ":svchost" ] |
| } |
| |
| migrated_manifest("crashsvc-test-manifest") { |
| deps = [ ":crashsvc-test" ] |
| } |