Skip to content

Commit

Permalink
Use array for rustflags to avoid conflicts with user flags
Browse files Browse the repository at this point in the history
  • Loading branch information
clarfonthey committed Jan 18, 2024
1 parent 6a4d1f8 commit 759785b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# to help locate python shared library in present working directory
[target.x86_64-unknown-linux-musl]
rustflags = "-C link-args=-Wl,-rpath,$ORIGIN"
rustflags = ["-C", "link-args=-Wl,-rpath,$ORIGIN"]
# linker = "x86_64-linux-musl-gcc"

[target.x86_64-unknown-linux-gnu]
rustflags = "-C link-args=-Wl,-rpath,$ORIGIN"
rustflags = ["-C", "link-args=-Wl,-rpath,$ORIGIN"]

[target.i686-unknown-linux-gnu]
rustflags = "-C link-args=-Wl,-rpath,$ORIGIN"
rustflags = ["-C", "link-args=-Wl,-rpath,$ORIGIN"]

[target.aarch64-unknown-linux-gnu]
rustflags = "-C link-args=-Wl,-rpath,$ORIGIN"
rustflags = ["-C", "link-args=-Wl,-rpath,$ORIGIN"]

[target.arm-unknown-linux-gnueabihf]
rustflags = "-C link-args=-Wl,-rpath,$ORIGIN"
rustflags = ["-C", "link-args=-Wl,-rpath,$ORIGIN"]

[target.arm-unknown-linux-musleabihf]
rustflags = "-C link-args=-Wl,-rpath,$ORIGIN"
rustflags = ["-C", "link-args=-Wl,-rpath,$ORIGIN"]

# to help locate python shared library in macOS in present working directory
# for x86_64-apple-darwin,we also turn on CPU optimization by default
# since there's only one kind of x86_64 CPU architecture for apple anyway
[target.x86_64-apple-darwin]
rustflags = "-C link-args=-Wl,-rpath,@loader_path -C target-cpu=native"
rustflags = ["-C", "link-args=-Wl,-rpath,@loader_path", "-C", "target-cpu=native"]

# sadly, we can't do the same for Apple Silicon, since GitHub's macOS action runners
# are still x86_64, and the Apple Silicon binary is cross-compiled using the
# macOS Intel runner
[target.aarch64-apple-darwin]
rustflags = "-C link-args=-Wl,-rpath,@loader_path"
rustflags = ["-C", "link-args=-Wl,-rpath,@loader_path"]

0 comments on commit 759785b

Please sign in to comment.