File tree 3 files changed +14
-8
lines changed
3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ struct Build {
129
129
submodules : Option < bool > ,
130
130
gdb : Option < String > ,
131
131
vendor : Option < bool > ,
132
+ nodejs : Option < String > ,
132
133
}
133
134
134
135
/// TOML representation of how the LLVM build is configured.
@@ -234,6 +235,7 @@ impl Config {
234
235
}
235
236
config. rustc = build. rustc . map ( PathBuf :: from) ;
236
237
config. cargo = build. cargo . map ( PathBuf :: from) ;
238
+ config. nodejs = build. nodejs . map ( PathBuf :: from) ;
237
239
config. gdb = build. gdb . map ( PathBuf :: from) ;
238
240
set ( & mut config. compiler_docs , build. compiler_docs ) ;
239
241
set ( & mut config. docs , build. docs ) ;
Original file line number Diff line number Diff line change @@ -81,15 +81,16 @@ pub fn check(build: &mut Build) {
81
81
82
82
need_cmd ( "python" . as_ref ( ) ) ;
83
83
84
- // Look for the nodejs command, needed for emscripten testing
85
- if let Some ( node) = have_cmd ( "node" . as_ref ( ) ) {
86
- build. config . nodejs = Some ( node) ;
87
- } else if let Some ( node) = have_cmd ( "nodejs" . as_ref ( ) ) {
88
- build. config . nodejs = Some ( node) ;
89
- }
90
84
91
85
if let Some ( ref s) = build. config . nodejs {
92
86
need_cmd ( s. as_ref ( ) ) ;
87
+ } else {
88
+ // Look for the nodejs command, needed for emscripten testing
89
+ if let Some ( node) = have_cmd ( "node" . as_ref ( ) ) {
90
+ build. config . nodejs = Some ( node) ;
91
+ } else if let Some ( node) = have_cmd ( "nodejs" . as_ref ( ) ) {
92
+ build. config . nodejs = Some ( node) ;
93
+ }
93
94
}
94
95
95
96
if let Some ( ref gdb) = build. config . gdb {
Original file line number Diff line number Diff line change @@ -1456,8 +1456,11 @@ actual:\n\
1456
1456
1457
1457
// If this is emscripten, then run tests under nodejs
1458
1458
if self . config . target . contains ( "emscripten" ) {
1459
- let nodejs = self . config . nodejs . clone ( ) . unwrap_or ( "nodejs" . to_string ( ) ) ;
1460
- args. push ( nodejs) ;
1459
+ if let Some ( ref p) = self . config . nodejs {
1460
+ args. push ( p. clone ( ) ) ;
1461
+ } else {
1462
+ self . fatal ( "no NodeJS binary found (--nodejs)" ) ;
1463
+ }
1461
1464
}
1462
1465
1463
1466
let exe_file = self . make_exe_name ( ) ;
You can’t perform that action at this time.
0 commit comments