Skip to content

Commit 7e46f2c

Browse files
author
Jake Goldsborough
committed
moving nodejs detection logic to configure and adding
a nodejs cmd sanity check
1 parent 0adcf46 commit 7e46f2c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/bootstrap/config.rs

+4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ pub struct Config {
7979
pub musl_root: Option<PathBuf>,
8080
pub prefix: Option<String>,
8181
pub codegen_tests: bool,
82+
pub nodejs: Option<PathBuf>,
8283
}
8384

8485
/// Per-target configuration stored in the global configuration structure.
@@ -391,6 +392,9 @@ impl Config {
391392
self.rustc = Some(PathBuf::from(value).join("bin/rustc"));
392393
self.cargo = Some(PathBuf::from(value).join("bin/cargo"));
393394
}
395+
"CFG_NODEJS" if value.len() > 0 => {
396+
self.nodejs = Some(PathBuf::from(value));
397+
}
394398
_ => {}
395399
}
396400
}

src/bootstrap/sanity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn check(build: &mut Build) {
7676
need_cmd("python".as_ref());
7777

7878
// If a manual nodejs was added to the config,
79-
// of if a nodejs install is detected through bootstrap.py, use it.
79+
// of if a nodejs install is detected through config, use it.
8080
if build.config.nodejs.is_some() {
8181
need_cmd("nodejs".as_ref())
8282
}

0 commit comments

Comments
 (0)