blob: 362031e7cbcee7e90c574c907cada8a132277e7e [file] [log] [blame] [edit]
# 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/rust/rustc_library.gni")
import("//src/sys/build/components.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(fxbug.dev/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 (target_cpu == "x64") {
rustflags += [ "-Ctarget-cpu=haswell" ]
}
if (target_cpu == "arm64") {
rustflags += [ "-Ctarget-cpu=cortex-a53" ]
}
}
fuchsia_unittest_package("mold-tests") {
deps = [ ":mold_test" ]
}