| # 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") |
| |
| executable("netsvc") { |
| 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 = [ |
| "debug-command.cc", |
| "debuglog.cc", |
| "netsvc.cc", |
| ] |
| deps = [ |
| ":args", |
| ":netsvc_common", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/fdio-caller", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/tftp", |
| "//zircon/public/lib/zx", |
| "//zircon/system/fidl/fuchsia-device:llcpp", |
| "//zircon/system/fidl/fuchsia-hardware-ethernet:c", |
| "//zircon/system/ulib/inet6", |
| ] |
| data_deps = [ |
| # netsvc launches /boot/bin/sh for netruncmd. |
| "//build/unification/data:bin.sh", |
| ] |
| } |
| |
| executable("device-name-provider") { |
| 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 = [ "device-name-provider.cc" ] |
| deps = [ |
| ":args", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/fidl-async-cpp", |
| "//zircon/public/lib/fs", |
| "//zircon/public/lib/svc", |
| "//zircon/system/fidl/fuchsia-device:llcpp", |
| "//zircon/system/ulib/inet6:netifc-discover", |
| ] |
| } |
| |
| source_set("args") { |
| sources = [ "args.cc" ] |
| } |
| |
| source_set("netsvc_common") { |
| sources = [ |
| "board-info.cc", |
| "file-api.cc", |
| "netboot.cc", |
| "netcp.cc", |
| "paver.cc", |
| "payload-streamer.cc", |
| "tftp.cc", |
| "zbi.cc", |
| ] |
| deps = [ |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/bootfs", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/fdio-caller", |
| "//zircon/public/lib/fidl-async-cpp", |
| "//zircon/public/lib/gpt", |
| "//zircon/public/lib/libzbi", |
| "//zircon/public/lib/sysconfig-sync-client", |
| "//zircon/system/fidl/fuchsia-boot:c", |
| "//zircon/system/fidl/fuchsia-device:llcpp", |
| "//zircon/system/fidl/fuchsia-device-manager:c", |
| "//zircon/system/fidl/fuchsia-hardware-block:llcpp", |
| "//zircon/system/fidl/fuchsia-kernel:c", |
| "//zircon/system/fidl/fuchsia-sysinfo:llcpp", |
| ] |
| public_deps = [ |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fzl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/tftp", |
| "//zircon/public/lib/zx", |
| "//zircon/system/fidl/fuchsia-paver:llcpp", |
| "//zircon/system/ulib/inet6", |
| ] |
| |
| # TODO(45621): UBSan has found an instance of undefined behavior in this target. |
| # Disable UBSan for this target temporarily until it is migrated into CI/CQ. |
| configs += [ "//build/config:temporarily_disable_ubsan_do_not_use" ] |
| |
| configs += [ "//build/config:Wno-unused-function" ] |
| } |
| |
| test("netsvc-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 = "netsvc-test" |
| sources = [ |
| "test/args-test.cc", |
| "test/file-api-test.cc", |
| "test/paver-test.cc", |
| "test/payload-streamer-test.cc", |
| "test/tftp-test.cc", |
| ] |
| include_dirs = [ "." ] |
| deps = [ |
| ":args", |
| ":netsvc_common", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/devmgr-integration-test", |
| "//zircon/public/lib/driver-integration-test", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/fidl-async-cpp", |
| "//zircon/public/lib/fs", |
| "//zircon/public/lib/ramdevice-client", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/fidl/fuchsia-device:llcpp", |
| "//zircon/system/fidl/fuchsia-sysinfo:llcpp", |
| ] |
| data_deps = [ ":netsvc" ] |
| configs += [ "//build/config:Wno-unused-function" ] |
| } |
| |
| test("netsvc-stress-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 = "netsvc-stress-test" |
| sources = [ "test/paver-stress-test.cc" ] |
| include_dirs = [ "." ] |
| deps = [ |
| ":netsvc_common", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/devmgr-integration-test", |
| "//zircon/public/lib/driver-integration-test", |
| "//zircon/public/lib/fdio", |
| "//zircon/public/lib/fidl-async-cpp", |
| "//zircon/public/lib/fs", |
| "//zircon/public/lib/ramdevice-client", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/fidl/fuchsia-device:llcpp", |
| "//zircon/system/fidl/fuchsia-sysinfo:llcpp", |
| ] |
| data_deps = [ ":netsvc" ] |
| } |
| |
| migrated_manifest("netsvc-manifest") { |
| deps = [ ":netsvc" ] |
| } |
| |
| migrated_manifest("device-name-provider-manifest") { |
| deps = [ ":device-name-provider" ] |
| } |
| |
| migrated_manifest("netsvc-test-manifest") { |
| deps = [ ":netsvc-test" ] |
| } |
| |
| migrated_manifest("netsvc-stress-test-manifest") { |
| deps = [ ":netsvc-stress-test" ] |
| } |