diff --git a/crates/neon-runtime/build.rs b/crates/neon-runtime/build.rs index d0d311976..a24cacd02 100644 --- a/crates/neon-runtime/build.rs +++ b/crates/neon-runtime/build.rs @@ -2,6 +2,7 @@ extern crate gcc; use std::process::Command; use std::env; +use std::path::Path; fn main() { // 1. Build the object file from source using node-gyp. @@ -57,8 +58,12 @@ fn build_object_file() { .find(node_lib_file_flag_pattern) .map(|i| i + node_lib_file_flag_pattern.len()) .expect("Couldn't find node_lib_file in node-gyp output."); - let node_lib_file_end_index = node_gyp_output[node_lib_file_start_index..].find(".lib").unwrap() + node_lib_file_start_index; - println!("cargo:node_lib_file={}", &node_gyp_output[node_lib_file_start_index..node_lib_file_end_index]); + let node_lib_file_end_index = node_gyp_output[node_lib_file_start_index..].find(".lib").unwrap() + node_lib_file_start_index + 4; + let node_lib_file = &node_gyp_output[node_lib_file_start_index..node_lib_file_end_index]; + //let file = Path::new(node_lib_file); + println!("test-output: {}", node_lib_file); + //println!("cargo:rustc-link-search=native={}", file.parent().unwrap().display()); + //println!("cargo:rustc-link-lib={}", file.file_stem().unwrap().to_str().unwrap()); } // Run `node-gyp build`.