| # Copyright 2020 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/package.gni") |
| import("//src/camera/debug.gni") |
| |
| group("device") { |
| public_deps = [ ":camera_device" ] |
| } |
| |
| source_set("lib") { |
| sources = [ |
| "device_impl.cc", |
| "device_impl.h", |
| "device_impl_client.cc", |
| "stream_impl.cc", |
| "stream_impl.h", |
| "stream_impl_client.cc", |
| "sysmem_allocator.cc", |
| "sysmem_allocator.h", |
| "util.h", |
| ] |
| |
| deps = [ |
| "//sdk/lib/syslog/cpp", |
| "//src/camera/lib/hanging_get_helper", |
| "//src/lib/fsl", |
| "//zircon/public/lib/fbl", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.camera2.hal", |
| "//sdk/fidl/fuchsia.camera3", |
| "//sdk/fidl/fuchsia.sysmem", |
| "//sdk/fidl/fuchsia.ui.policy", |
| "//sdk/lib/fidl/cpp", |
| "//sdk/lib/sys/cpp", |
| "//zircon/public/lib/fit", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/trace", |
| ] |
| |
| defines = [ camera_debug_define ] |
| } |
| |
| executable("bin") { |
| output_name = "device" |
| |
| sources = [ "main.cc" ] |
| |
| deps = [ |
| ":lib", |
| "//sdk/lib/syslog/cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/trace-provider:trace-provider-with-fdio", |
| ] |
| |
| defines = [ camera_debug_define ] |
| } |
| |
| package("camera_device") { |
| deps = [ ":bin" ] |
| |
| binaries = [ |
| { |
| name = "device" |
| }, |
| ] |
| meta = [ |
| { |
| path = "${target_name}.cmx" |
| dest = "${target_name}.cmx" |
| }, |
| ] |
| } |
| |
| executable("unittests") { |
| testonly = true |
| output_name = "camera_device_unittests" |
| sources = [ |
| "device_impl_unittest.cc", |
| "sysmem_allocator_unittest.cc", |
| "util_unittest.cc", |
| ] |
| deps = [ |
| ":lib", |
| "testing", |
| "//sdk/fidl/fuchsia.camera2.hal", |
| "//sdk/fidl/fuchsia.camera3", |
| "//sdk/fidl/fuchsia.sysmem", |
| "//sdk/lib/sys/cpp", |
| "//sdk/lib/sys/cpp/testing:unit", |
| "//src/camera/lib/fake_controller", |
| "//src/lib/fsl", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| ] |
| |
| # Increase the default stack size from 256 KB because creating the configs can take up a very |
| # large amount of stack and would otherwise cause crashes on ASAN builds. |
| ldflags = [ "-Wl,-z,stack-size=0x100000" ] |
| } |