File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
use std:: env;
2
+ use std:: path:: Path ;
2
3
3
4
/// Set up the build environment by setting Cargo configuration variables.
4
5
pub fn setup ( ) {
@@ -7,7 +8,10 @@ pub fn setup() {
7
8
let configuration = if debug { "Debug" } else { "Release" } ;
8
9
let node_root_dir = env:: var ( "DEP_NEON_RUNTIME_NODE_ROOT_DIR" ) . unwrap ( ) ;
9
10
let node_lib_file = env:: var ( "DEP_NEON_RUNTIME_NODE_LIB_FILE" ) . unwrap ( ) ;
11
+ let node_lib_path = Path :: new ( & node_lib_file) ;
10
12
println ! ( "cargo:rustc-link-search={}\\ {}" , node_root_dir, configuration) ;
11
- println ! ( "cargo:rustc-link-lib={}" , node_lib_file) ;
13
+ //println!("cargo:rustc-link-search=native={}", &node_lib_path.parent().unwrap().display());
14
+ println ! ( "cargo:rustc-link-search=native={}" , "C:\\ Users\\ Languages\\ .node-gyp\\ 8.2.1\\ x64" ) ;
15
+ println ! ( "cargo:rustc-link-lib={}" , & node_lib_path. file_stem( ) . unwrap( ) . to_str( ) . unwrap( ) ) ;
12
16
}
13
17
}
Original file line number Diff line number Diff line change @@ -57,8 +57,9 @@ fn build_object_file() {
57
57
. find ( node_lib_file_flag_pattern)
58
58
. map ( |i| i + node_lib_file_flag_pattern. len ( ) )
59
59
. expect ( "Couldn't find node_lib_file in node-gyp output." ) ;
60
- let node_lib_file_end_index = node_gyp_output[ node_lib_file_start_index..] . find ( ".lib" ) . unwrap ( ) + node_lib_file_start_index;
61
- println ! ( "cargo:node_lib_file={}" , & node_gyp_output[ node_lib_file_start_index..node_lib_file_end_index] ) ;
60
+ let node_lib_file_end_index = node_gyp_output[ node_lib_file_start_index..] . find ( "'" ) . unwrap ( ) + node_lib_file_start_index;
61
+ let node_lib_file = & node_gyp_output[ node_lib_file_start_index..node_lib_file_end_index] ;
62
+ println ! ( "cargo:node_lib_file={}" , node_lib_file) ;
62
63
}
63
64
64
65
// Run `node-gyp build`.
You can’t perform that action at this time.
0 commit comments