File tree 4 files changed +18
-5
lines changed
4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ fn main() {
53
53
}
54
54
}
55
55
( false , false , false , true ) => {
56
+ // Add compability headers to make `#include <Block.h>` work.
56
57
let compat_headers = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "compat-headers/objfw" ) ;
57
58
cc_args. push_str ( " -I" ) ;
58
59
cc_args. push_str ( compat_headers. to_str ( ) . unwrap ( ) ) ;
Original file line number Diff line number Diff line change 1
- use std:: env;
1
+ use std:: { env, path :: Path } ;
2
2
3
3
/// TODO: Better validation of this
4
4
///
@@ -219,11 +219,21 @@ fn main() {
219
219
// - `-miphoneos-version-min={}`
220
220
// - `-mmacosx-version-min={}`
221
221
// - ...
222
- println ! (
223
- "cargo:cc_args=-fobjc-arc -fobjc-arc-exceptions -fobjc-exceptions -fobjc-runtime={}" ,
224
- // TODO: -fobjc-weak ?
222
+ //
223
+ // TODO: -fobjc-weak ?
224
+ let mut cc_args = format ! (
225
+ "-fobjc-arc -fobjc-arc-exceptions -fobjc-exceptions -fobjc-runtime={}" ,
225
226
clang_runtime
226
- ) ; // DEP_OBJC_CC_ARGS
227
+ ) ;
228
+
229
+ if let Runtime :: ObjFW ( _) = & runtime {
230
+ // Add compability headers to make `#include <objc/objc.h>` work.
231
+ let compat_headers = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "compat-headers-objfw" ) ;
232
+ cc_args. push_str ( " -I" ) ;
233
+ cc_args. push_str ( compat_headers. to_str ( ) . unwrap ( ) ) ;
234
+ }
235
+
236
+ println ! ( "cargo:cc_args={}" , cc_args) ; // DEP_OBJC_CC_ARGS
227
237
228
238
if let Runtime :: ObjFW ( _) = & runtime {
229
239
// Link to libobjfw-rt
Original file line number Diff line number Diff line change
1
+ #import < ObjFW/ObjFW-RT.h>
Original file line number Diff line number Diff line change
1
+ #import < ObjFW/ObjFW-RT.h>
You can’t perform that action at this time.
0 commit comments