| # 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/board.gni") |
| import("//build/package.gni") |
| import("//build/rust/rustc_library.gni") |
| import("//build/test/test_package.gni") |
| |
| rustc_library("mold") { |
| name = "mold" |
| with_unit_tests = true |
| version = "0.1.0" |
| edition = "2018" |
| deps = [ |
| "//src/graphics/lib/compute/surpass", |
| "//third_party/rust_crates:rustc-hash", |
| ] |
| |
| # TODO(56138): Fix the leaks and remove this. |
| test_deps = [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ] |
| |
| configs += [ ":mold-performance" ] |
| |
| sources = [ |
| "src/buffer.rs", |
| "src/composition.rs", |
| "src/layer.rs", |
| "src/lib.rs", |
| "src/path/mod.rs", |
| "src/path/segments.rs", |
| "src/path/transform.rs", |
| "src/point.rs", |
| "src/segment.rs", |
| "src/utils.rs", |
| ] |
| } |
| |
| config("mold-performance") { |
| rustflags = [ "-Copt-level=3" ] |
| |
| if (board_name == "chromebook-x64") { |
| rustflags += [ "-Ctarget-cpu=skylake" ] |
| } |
| |
| if (board_name == "astro" || board_name == "sherlock") { |
| rustflags += [ "-Ctarget-cpu=cortex-a53" ] |
| } |
| } |
| |
| unittest_package("mold-tests") { |
| deps = [ ":mold_test" ] |
| tests = [ |
| { |
| name = "mold_lib_test" |
| environments = basic_envs |
| }, |
| ] |
| } |