summaryrefslogtreecommitdiff
path: root/BUILD.gn
diff options
context:
space:
mode:
Diffstat (limited to 'BUILD.gn')
-rw-r--r--BUILD.gn19
1 files changed, 19 insertions, 0 deletions
diff --git a/BUILD.gn b/BUILD.gn
index f9b3afc08..921754ef1 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -119,12 +119,25 @@ group("deno_deps") {
]
}
+# 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 = "src/main.rs"
extern = main_extern
deps = [
":deno_deps",
]
+
+ # 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.
+ crate_version = deno_cargo_info.version
+ inputs = [
+ "Cargo.toml",
+ ]
}
rust_test("test_rs") {
@@ -133,6 +146,12 @@ rust_test("test_rs") {
deps = [
":deno_deps",
]
+
+ # Extract version from Cargo.toml
+ crate_version = deno_cargo_info.version
+ inputs = [
+ "Cargo.toml",
+ ]
}
rust_executable("hyper_hello") {