Skip to content

Commit f01b240

Browse files
authored
Merge pull request #1198 from xcodz-dot/patch-1
Update README.md to merge "Bundled" section Codeblocks
2 parents 3aeeefc + 6ea1338 commit f01b240

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ SDL2 >= 2.0.8 is recommended to use these bindings, but note that SDL2 >= 2.0.5
4343

4444
Since 0.31, this crate supports a feature named "bundled" which compiles SDL2 from source and links it automatically. While this should work for any architecture, you **will** need a C compiler (like `gcc`, `clang`, or MS's own compiler) to use this feature properly.
4545

46-
By default, macOS and Linux only load libraries from system directories like `/usr/lib`. If you wish to distribute the newly built libSDL2.so/libSDL2.dylib alongside your executable, you will need to add rpath to your executable. Add the following line to `build.rs` script:
47-
* on macOS:
48-
```rust
49-
println!("cargo:rustc-link-arg=-Wl,-rpath,@loader_path");
50-
```
51-
* on Linux:
46+
By default, macOS and Linux only load libraries from system directories like `/usr/lib`. If you wish to distribute the newly built libSDL2.so/libSDL2.dylib alongside your executable, you will need to add rpath to your executable. Add the following lines to `build.rs` script:
47+
5248
```rust
53-
println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN");
49+
[cfg(target_os="macos")]
50+
println!("cargo:rustc-link-arg=-Wl,-rpath,@loader_path");
51+
52+
[cfg(target_os="linux")]
53+
println!("cargo:rustc-link-arg=-Wl,-rpath,$ORIGIN");
5454
```
5555

5656
### Linux

0 commit comments

Comments
 (0)