Skip to content

Commit

Permalink
Review comment. Replace OUT_DIR with DENO_BUILD_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Oct 31, 2018
1 parent e723708 commit 2d5bcdf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ fn main() {
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");
// TODO Remove this and only use OUT_DIR at some point.
println!("cargo:rustc-env=DENO_BUILD_PATH={}", deno_build_path);

let status = Command::new("python")
.env("DENO_BUILD_PATH", &deno_build_path)
Expand Down
7 changes: 5 additions & 2 deletions build_extra/rust/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import sys
import os

os.environ["OUT_DIR"] = os.path.abspath(".")
assert os.path.isdir(os.environ["OUT_DIR"])
# TODO This is for src/msg.rs to know where to find msg_generated.rs
# In the future we should use OUT_DIR here.
os.environ["DENO_BUILD_PATH"] = os.path.abspath(".")
assert os.path.isdir(os.environ["DENO_BUILD_PATH"])

sys.exit(subprocess.call(sys.argv[1:], env=os.environ))
4 changes: 3 additions & 1 deletion src/msg.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#![allow(unused_imports)]
#![allow(dead_code)]
use flatbuffers;
include!(concat!(env!("OUT_DIR"), "/gen/msg_generated.rs"));
// TODO Replace DENO_BUILD_PATH with OUT_DIR. gn/ninja should generate into
// the same output directory as cargo uses.
include!(concat!(env!("DENO_BUILD_PATH"), "/gen/msg_generated.rs"));

0 comments on commit 2d5bcdf

Please sign in to comment.