Skip to content

Commit 647851e

Browse files
committed
Fix linking neon-runtime on windows.
-l is only intended to communicate the names of libraries See rust-lang/rust#38850 for more details.
1 parent dc91f46 commit 647851e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/neon-runtime/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ extern crate gcc;
22

33
use std::process::Command;
44
use std::env;
5+
use std::path::Path;
56

67
fn main() {
78
// 1. Build the object file from source using node-gyp.
@@ -58,7 +59,10 @@ fn build_object_file() {
5859
.map(|i| i + node_lib_file_flag_pattern.len())
5960
.expect("Couldn't find node_lib_file in node-gyp output.");
6061
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]);
62+
let node_lib_file = &node_gyp_output[node_lib_file_start_index..node_lib_file_end_index];
63+
let file = Path::new(node_lib_file);
64+
println!("cargo:rustc-link-search=native={}", file.parent().unwrap().display());
65+
println!("cargo:rustc-link-lib={}", file.file_name().unwrap().to_str().unwrap());
6266
}
6367

6468
// Run `node-gyp build`.

0 commit comments

Comments
 (0)