Skip to content

Commit

Permalink
UAdd linker flags on macos builds (pyo3 compatibility)
Browse files Browse the repository at this point in the history
  • Loading branch information
mufeedvh committed Jan 19, 2025
1 parent 612712c commit 4de0b86
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ license = "MIT"
readme = "README.md"
exclude = [".github/*", ".assets/*"]
edition = "2021"
build = "build.rs"

[[bin]]
name = "code2prompt"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ cargo install code2prompt
For unpublished builds:

```sh
cargo install --git https://github.com/mufeedvh/code2prompt
cargo install --git https://github.com/mufeedvh/code2prompt --force
```

### AUR
Expand Down
8 changes: 8 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fn main() {
// Check if we're compiling for macOS
if cfg!(target_os = "macos") {
// Add the necessary flags for PyO3 on macOS
println!("cargo:rustc-link-arg=-undefined");
println!("cargo:rustc-link-arg=dynamic_lookup");
}
}

0 comments on commit 4de0b86

Please sign in to comment.