Skip to content

Commit bb150e4

Browse files
committed
Rename DEP_OBJC_CLANG_ARGS -> DEP_OBJC_CC_ARGS
1 parent 308af65 commit bb150e4

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

objc2_exception/build.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ fn main() {
66
let mut builder = cc::Build::new();
77
builder.file("extern/exception.m");
88

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(' ') {
1210
builder.flag(flag);
1311
}
1412

objc2_sys/build.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -130,22 +130,19 @@ fn main() {
130130
}
131131
};
132132

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.
134141
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 ?
139144
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
149146

150147
// Link to libobjc
151148
println!("cargo:rustc-link-lib=dylib=objc");

0 commit comments

Comments
 (0)