forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Based on code from @qti3e and @piscisaureus in denoland#724 and denoland#1125 respectively. - TODO The DENO_BUILD_PATH env var must be supplied and must be an absolute path, this restriction should be removed in future work.
Showing
5 changed files
with
111 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# build | ||
/out/ | ||
/target/ | ||
*.pyc | ||
gclient_config.py_entries | ||
Cargo.lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2018 the Deno authors. All rights reserved. MIT license. | ||
|
||
// Run "cargo build -vv" if you want to see gn output. | ||
// TODO For the time being you must set an env var DENO_BUILD_PATH | ||
// which might be `pwd`/out/debug or `pwd`/out/release. | ||
// TODO Currently DENO_BUILD_PATH must be absolute. | ||
// TODO Combine DENO_BUILD_PATH and OUT_DIR. | ||
|
||
use std::env; | ||
use std::process::Command; | ||
use std::process::Stdio; | ||
fn main() { | ||
let mode = env::var("PROFILE").unwrap(); | ||
let deno_build_path = env::var("DENO_BUILD_PATH").unwrap(); | ||
|
||
let status = Command::new("./tools/setup.py") | ||
.env("DENO_BUILD_PATH", &deno_build_path) | ||
.env("DENO_BUILD_MODE", &mode) | ||
.stdout(Stdio::inherit()) | ||
.stderr(Stdio::inherit()) | ||
.status() | ||
.expect("setup.py failed"); | ||
assert!(status.success()); | ||
|
||
// These configurations must be outputed after tools/setup.py is run. | ||
println!("cargo:rustc-env=OUT_DIR={}", deno_build_path); | ||
println!("cargo:rustc-link-search=native={}/obj", deno_build_path); | ||
println!("cargo:rustc-link-lib=static=deno_deps"); | ||
|
||
let status = Command::new("python") | ||
.env("DENO_BUILD_PATH", &deno_build_path) | ||
.env("DENO_BUILD_MODE", &mode) | ||
.arg("./tools/build.py") | ||
.arg("deno_deps") | ||
.arg("-v") | ||
.stdout(Stdio::inherit()) | ||
.stderr(Stdio::inherit()) | ||
.status() | ||
.expect("build.py failed"); | ||
assert!(status.success()); | ||
} |