| # 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/components.gni") |
| import("//build/rust/rustc_library.gni") |
| |
| rustc_library("forma") { |
| name = "forma" |
| with_unit_tests = true |
| version = "0.1.0" |
| edition = "2021" |
| deps = [ |
| "//src/graphics/lib/compute/surpass", |
| "//src/lib/trace/rust:trace", |
| "//third_party/rust_crates:rustc-hash", |
| ] |
| |
| # TODO(fxbug.dev/56138): Fix the leaks and remove this. |
| test_deps = [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| |
| configs += [ ":forma-performance" ] |
| |
| sources = [ |
| "src/buffer.rs", |
| "src/composition/interner.rs", |
| "src/composition/layer.rs", |
| "src/composition/mod.rs", |
| "src/composition/state.rs", |
| "src/layer.rs", |
| "src/lib.rs", |
| "src/renderer/cpu.rs", |
| "src/renderer/mod.rs", |
| "src/small_bit_set.rs", |
| "src/utils.rs", |
| ] |
| } |
| |
| config("forma-performance") { |
| # Enable all optimizations that benefit speed, even if they increase size |
| configs = [ "//build/config:optimize_speed" ] |
| |
| if (target_cpu == "x64") { |
| # TODO(fxbug.dev/87582): not all x64 targets are haswell. |
| # Consider moving this to a board config. |
| configs += [ "//build/config/x64:haswell" ] |
| } |
| |
| if (target_cpu == "arm64") { |
| # TODO(fxbug.dev/87243): the flag below is not added by default. |
| # It's safe to remove the line below when //build/config/arm64:cortex-a53 |
| # picks up this flag. |
| # Also note that not all arm64 targets are cortex-a53. |
| # Depending on your target board this optimization flag may actually |
| # cause a regression. |
| rustflags = [ "-Ctarget-cpu=cortex-a53" ] |
| } |
| } |
| |
| fuchsia_unittest_package("forma-tests") { |
| deps = [ ":forma_test" ] |
| } |