-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 #724 and #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.
- Loading branch information
Showing
6 changed files
with
70 additions
and
8 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,37 @@ | ||
// 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; | ||
|
||
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) | ||
.status() | ||
.expect("setup.py failed"); | ||
assert!(status.success()); | ||
|
||
// These configurations must be outputted 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") | ||
.status() | ||
.expect("build.py failed"); | ||
assert!(status.success()); | ||
} |
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