Skip to content

Commit

Permalink
fix: static link Windows msvc runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Aug 16, 2023
1 parent e95f28e commit f270d08
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]
rustflags = ["-C", "target-feature=-crt-static"]
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
[target.i686-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
3 changes: 2 additions & 1 deletion src/repo.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::borrow::Borrow;
use std::path::{Path, PathBuf};

use napi::{bindgen_prelude::*, JsString};
Expand Down Expand Up @@ -522,6 +521,8 @@ fn get_file_modified_date(
fn path_to_javascript_string(env: &Env, p: &Path) -> Result<JsString> {
#[cfg(unix)]
{
use std::borrow::Borrow;

let path = p.to_string_lossy();
env.create_string(path.borrow())
}
Expand Down

0 comments on commit f270d08

Please sign in to comment.