Skip to content

Commit

Permalink
Fix linking neon-runtime on windows.
Browse files Browse the repository at this point in the history
-l is only intended to communicate the names of libraries

See rust-lang/rust#38850 for more details.
  • Loading branch information
hone committed Aug 9, 2017
1 parent dc91f46 commit 961fbf2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/neon-runtime/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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`.
Expand Down

0 comments on commit 961fbf2

Please sign in to comment.