Skip to content

Commit 833f593

Browse files
committed
Add -ObjC link flag to fix OSX crashes
Add `-ObjC` link flag when building on OSX. As noted in SFML/SFML#2920, this is required when statically linking against SFML since it contains Objective-C source files. Without this flag, compiling and linking succeeds but binaries will crash at runtime.
1 parent 88fefd8 commit 833f593

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

build.rs

+3
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,9 @@ fn main() {
303303
if feat_audio {
304304
unix_audio_link_support_libs();
305305
}
306+
// SFML contains Objective-C source files on OSX
307+
// https://github.com/SFML/SFML/issues/2920
308+
println!("cargo::rustc-link-arg=-ObjC");
306309
} else {
307310
panic!("Uhhh... Can't determine your environment. Sorry.");
308311
}

0 commit comments

Comments
 (0)