File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -42,13 +42,20 @@ fn main() {
4242 . write_to_file ( out_path. join ( "bindings.rs" ) )
4343 . expect ( "Couldn't write bindings" ) ;
4444
45- // Deterimine if we're building for MSVC
45+ // Deterimine build platform
4646 let target = env:: var ( "TARGET" ) . unwrap ( ) ;
4747 let msvc = target. contains ( "msvc" ) ;
48+ let apple = target. contains ( "apple" ) ;
49+
4850 // Build libui if needed. Otherwise, assume it's in lib/
4951 let mut dst;
5052 if cfg ! ( feature = "build" ) {
51- dst = Config :: new ( "libui" ) . build_target ( "" ) . profile ( "release" ) . build ( ) ;
53+ let mut cfg = Config :: new ( "libui" ) ;
54+ cfg. build_target ( "" ) . profile ( "release" ) ;
55+ if apple {
56+ cfg. cxxflag ( "--stdlib=libc++" ) ;
57+ }
58+ dst = cfg. build ( ) ;
5259
5360 let mut postfix = Path :: new ( "build" ) . join ( "out" ) ;
5461 if msvc {
@@ -62,7 +69,7 @@ fn main() {
6269 }
6370
6471 let libname;
65- if msvc {
72+ if msvc {
6673 libname = "libui" ;
6774 } else {
6875 libname = "ui" ;
You can’t perform that action at this time.
0 commit comments