| # Copyright 2021 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") |
| |
| assert(is_host, "gn_desc is only supported on the host") |
| |
| # A crate for a graph of GN targets |
| rustc_library("gn_graph") { |
| edition = "2021" |
| |
| # This needs to be compiled with optimizations enabled to be at all |
| # performant when deserializing the 100s of MBs of `gn desc` json output. |
| configs += [ "//build/config:optimize_speed" ] |
| |
| deps = [ |
| "//third_party/rust_crates:petgraph", |
| "//third_party/rust_crates:thiserror", |
| "//tools/gn_desc/gn_json", |
| ] |
| |
| source_root = "src/lib.rs" |
| sources = [ "src/lib.rs" ] |
| } |
| |
| # And its unit-tests |
| rustc_test("gn_graph_tests") { |
| edition = "2021" |
| source_root = "src/lib.rs" |
| deps = [ |
| "//third_party/rust_crates:petgraph", |
| "//third_party/rust_crates:thiserror", |
| "//tools/gn_desc/gn_json", |
| ] |
| sources = [ "src/lib.rs" ] |
| } |
| |
| # All the tests. |
| group("tests") { |
| testonly = true |
| deps = [ ":gn_graph_tests" ] |
| } |