File tree Expand file tree Collapse file tree 2 files changed +12
-17
lines changed Expand file tree Collapse file tree 2 files changed +12
-17
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,7 @@ fn main() {
6
6
let mut builder = cc:: Build :: new ( ) ;
7
7
builder. file ( "extern/exception.m" ) ;
8
8
9
- // Assume the C compiler is clang; if it isn't, this is probably going to
10
- // fail anyways.
11
- for flag in env:: var ( "DEP_OBJC_CLANG_ARGS" ) . unwrap ( ) . split ( ' ' ) {
9
+ for flag in env:: var ( "DEP_OBJC_CC_ARGS" ) . unwrap ( ) . split ( ' ' ) {
12
10
builder. flag ( flag) ;
13
11
}
14
12
Original file line number Diff line number Diff line change @@ -130,22 +130,19 @@ fn main() {
130
130
}
131
131
} ;
132
132
133
- // Add clang arguments
133
+ // let gcc_args = match &runtime {
134
+ // Apple(_) => "-fnext-runtime -fobjc-abi-version=2",
135
+ // _ => "-fgnu-runtime",
136
+ // };
137
+
138
+ // Add CC arguments
139
+ // Assume the compiler is clang; if it isn't, this is probably going to
140
+ // fail anyways, since we're using newer runtimes than GCC supports.
134
141
println ! (
135
- "cargo:clang_args=-fobjc-arc -fobjc-arc-exceptions -fobjc-exceptions -fobjc-runtime={}" ,
136
- // `-fobjc-link-runtime` -> people don't need to specify `-lobjc`.
137
-
138
- // -fobjc-weak ?
142
+ "cargo:cc_args=-fobjc-arc -fobjc-arc-exceptions -fobjc-exceptions -fobjc-runtime={}" ,
143
+ // TODO: -fobjc-weak ?
139
144
clang_runtime
140
- ) ; // DEP_OBJC_CLANG_ARGS
141
-
142
- // Add GCC arguments. Not really supported
143
- match runtime {
144
- Apple ( _) => {
145
- println ! ( "cargo:gcc_args=-fnext-runtime -fobjc-exceptions -fobjc-abi-version=2" )
146
- }
147
- _ => println ! ( "cargo:gcc_args=-fgnu-runtime -fobjc-exceptions" ) ,
148
- } // DEP_OBJC_GCC_ARGS
145
+ ) ; // DEP_OBJC_CC_ARGS
149
146
150
147
// Link to libobjc
151
148
println ! ( "cargo:rustc-link-lib=dylib=objc" ) ;
You can’t perform that action at this time.
0 commit comments