Skip to content

Commit

Permalink
Use relative path for local builds on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy committed Nov 12, 2023
1 parent 92e57fb commit 65b9a5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions deno_bindgen_cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ fn main() -> std::io::Result<()> {
let name = cargo::metadata()?;
println!("Initializing {name}");

unsafe {
dlfcn::load_and_init(&PathBuf::from(path), opt.out, opt.lazy_init)?
};
let path = PathBuf::from(path);
// https://github.com/denoland/deno/issues/21172
#[cfg(target_os = "windows")]
let path = path
.strip_prefix(&cwd)
.expect("path is not a prefix of cwd");

unsafe { dlfcn::load_and_init(&path, opt.out, opt.lazy_init)? };

println!("Ready {name}");
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion e2e_test/bindings/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

const { dlopen } = Deno;

const { symbols } = dlopen('/Users/divy/gh/deno_bindgen/e2e_test/target/debug/libdeno_bindgen_e2e.dylib', {
const { symbols } = dlopen('target/debug/libdeno_bindgen_e2e.dylib', {
add: {
parameters: [
'i32',
Expand Down

0 comments on commit 65b9a5b

Please sign in to comment.