# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. import("//build/toolchain/cc_wrapper.gni") import("//build_extra/rust/rust.gni") main_extern = [ { label = "../core:deno" crate_name = "deno" crate_type = "rlib" }, { label = "../cli_snapshots:deno_cli_snapshots" crate_name = "deno_cli_snapshots" crate_type = "rlib" }, { label = "../deno_typescript:deno_typescript" crate_name = "deno_typescript" crate_type = "rlib" }, { label = "$rust_build:serde_derive" crate_name = "serde_derive" crate_type = "proc_macro" }, ] main_extern_rlib = [ "ansi_term", "atty", "clap", "dirs", "futures", "http", "hyper", "hyper_rustls", "indexmap", "lazy_static", "libc", "log", "rand", "regex", "remove_dir_all", "reqwest", "ring", "rustyline", "serde", "serde_json", "source_map_mappings", "tempfile", "termcolor", "tokio", "tokio_executor", "tokio_fs", "tokio_io", "tokio_process", "tokio_rustls", "tokio_threadpool", "url", "utime", ] if (is_win) { main_extern_rlib += [ "fwdansi", "winapi", ] } if (is_posix) { main_extern_rlib += [ "nix" ] } # Reads the cargo info from Cargo.toml deno_cargo_info = exec_script("../build_extra/rust/get_cargo_info.py", [ rebase_path("Cargo.toml", root_build_dir) ], "json") rust_executable("deno") { source_root = "main.rs" extern = main_extern extern_rlib = main_extern_rlib # Extract version from Cargo.toml # TODO integrate this into rust.gni by allowing the rust_executable template # to specify a cargo.toml from which it will extract a version. inputs = [ "Cargo.toml", ] env = [ "CARGO_PKG_VERSION=${deno_cargo_info.version}" ] } rust_test("cli_test") { source_root = "main.rs" extern = main_extern extern_rlib = main_extern_rlib # Extract version from Cargo.toml inputs = [ "Cargo.toml", ] env = [ "CARGO_PKG_VERSION=${deno_cargo_info.version}" ] }