File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ fn main() {
5353 }
5454 }
5555 ( false , false , false , true ) => {
56+ // Add compability headers to make `#include <Block.h>` work.
5657 let compat_headers = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "compat-headers/objfw" ) ;
5758 cc_args. push_str ( " -I" ) ;
5859 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 } ;
22
33/// TODO: Better validation of this
44///
@@ -219,11 +219,21 @@ fn main() {
219219 // - `-miphoneos-version-min={}`
220220 // - `-mmacosx-version-min={}`
221221 // - ...
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={}" ,
225226 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
227237
228238 if let Runtime :: ObjFW ( _) = & runtime {
229239 // 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