| # Copyright 2017 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("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/test/test_package.gni") |
| |
| rustc_library("fuchsia-framebuffer") { |
| name = "fuchsia_framebuffer" |
| version = "0.1.0" |
| edition = "2018" |
| with_unit_tests = true |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.display:fuchsia.hardware.display-rustc", |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem-rustc", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/fuchsia-runtime", |
| "//src/lib/mapped-vmo", |
| "//src/lib/shared-buffer", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ |
| "src/lib.rs", |
| "src/sysmem.rs", |
| ] |
| } |
| |
| unittest_package("fuchsia-framebuffer-tests") { |
| deps = [ ":fuchsia-framebuffer_test" ] |
| |
| tests = [ |
| { |
| name = "fuchsia_framebuffer_lib_test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| rustc_binary("box") { |
| version = "0.1.0" |
| edition = "2018" |
| with_unit_tests = true |
| source_root = "examples/box.rs" |
| deps = [ |
| "//src/lib/fuchsia-async", |
| "//src/lib/ui/fuchsia-framebuffer", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ "examples/box.rs" ] |
| } |
| |
| package("fb_box_rs") { |
| deps = [ ":box" ] |
| |
| binaries = [ |
| { |
| name = "box" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/box.cmx") |
| dest = "fb_box_rs.cmx" |
| }, |
| ] |
| } |
| |
| rustc_binary("fb_integration_test_bin") { |
| name = "fb_integration_test" |
| edition = "2018" |
| source_root = "tests/fb_integration_test.rs" |
| deps = [ |
| "//src/lib/fuchsia-async", |
| "//src/lib/ui/fuchsia-framebuffer", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ "tests/fb_integration_test.rs" ] |
| } |
| |
| test_package("fb_integration_test") { |
| deps = [ ":fb_integration_test_bin" ] |
| |
| tests = [ |
| { |
| name = "fb_integration_test" |
| environments = [ nuc_env ] |
| }, |
| ] |
| } |
| |
| group("examples") { |
| public_deps = [ "//src/lib/ui/fuchsia-framebuffer:fb_box_rs" ] |
| } |