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 647851e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion 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 @@ -58,7 +59,10 @@ fn build_object_file() {
.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 = &node_gyp_output[node_lib_file_start_index..node_lib_file_end_index];
let file = Path::new(node_lib_file);
println!("cargo:rustc-link-search=native={}", file.parent().unwrap().display());
println!("cargo:rustc-link-lib={}", file.file_name().unwrap().to_str().unwrap());
}

// Run `node-gyp build`.
Expand Down

0 comments on commit 647851e

Please sign in to comment.