Skip to content

Commit 3e10a26

Browse files
authored
Merge pull request #294 from alexcrichton/ios
Some tweaks for iOS
2 parents dc2a324 + 0626263 commit 3e10a26

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,8 +1082,10 @@ impl Build {
10821082
cmd.args.push(format!("-O{}", opt_level).into());
10831083
}
10841084

1085-
cmd.push_cc_arg("-ffunction-sections".into());
1086-
cmd.push_cc_arg("-fdata-sections".into());
1085+
if !target.contains("-ios") {
1086+
cmd.push_cc_arg("-ffunction-sections".into());
1087+
cmd.push_cc_arg("-fdata-sections".into());
1088+
}
10871089
if self.pic.unwrap_or(!target.contains("windows-gnu")) {
10881090
cmd.push_cc_arg("-fPIC".into());
10891091
}
@@ -1462,6 +1464,10 @@ impl Build {
14621464

14631465
cmd.args.push("-isysroot".into());
14641466
cmd.args.push(sdk_path.trim().into());
1467+
cmd.args.push("-fembed-bitcode".into());
1468+
if self.get_opt_level()? == "0" {
1469+
cmd.args.push("-fembed-bitcode-marker".into());
1470+
}
14651471

14661472
Ok(())
14671473
}

0 commit comments

Comments
 (0)