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() {
42
42
. write_to_file ( out_path. join ( "bindings.rs" ) )
43
43
. expect ( "Couldn't write bindings" ) ;
44
44
45
- // Deterimine if we're building for MSVC
45
+ // Deterimine build platform
46
46
let target = env:: var ( "TARGET" ) . unwrap ( ) ;
47
47
let msvc = target. contains ( "msvc" ) ;
48
+ let apple = target. contains ( "apple" ) ;
49
+
48
50
// Build libui if needed. Otherwise, assume it's in lib/
49
51
let mut dst;
50
52
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 ( ) ;
52
59
53
60
let mut postfix = Path :: new ( "build" ) . join ( "out" ) ;
54
61
if msvc {
@@ -62,7 +69,7 @@ fn main() {
62
69
}
63
70
64
71
let libname;
65
- if msvc {
72
+ if msvc {
66
73
libname = "libui" ;
67
74
} else {
68
75
libname = "ui" ;
You can’t perform that action at this time.
0 commit comments