Skip to content

Commit

Permalink
simplify?
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Sep 10, 2023
1 parent a5ce8f9 commit af3a2ab
Showing 1 changed file with 8 additions and 24 deletions.
32 changes: 8 additions & 24 deletions src/zig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,31 +247,15 @@ impl Zig {
}
if is_macos {
// See https://github.com/apple-oss-distributions/libiconv/blob/a167071feb7a83a01b27ec8d238590c14eb6faff/xcodeconfig/libiconv.xcconfig
if (zig_version.major, zig_version.minor) >= (0, 12) {
if cmd_args.iter().any(|x| x == "-liconv")
&& !cmd_args.iter().any(|x| x == "-lcharset")
{
new_cmd_args.push("-lcharset".to_string());
}
if let Some(ref sdkroot) = Self::macos_sdk_root() {
new_cmd_args.extend_from_slice(&[
format!("--sysroot={}", sdkroot.display()),
"-isystem".to_string(),
format!("{}", sdkroot.join("usr").join("include").display()),
format!("-L{}", sdkroot.join("usr").join("lib").display()),
format!(
"-F{}",
sdkroot
.join("System")
.join("Library")
.join("Frameworks")
.display()
),
"-DTARGET_OS_IPHONE=0".to_string(),
]);
}
} else if let Some(ref sdkroot) = Self::macos_sdk_root() {
if (zig_version.major, zig_version.minor) >= (0, 12)
&& cmd_args.iter().any(|x| x == "-liconv")
&& !cmd_args.iter().any(|x| x == "-lcharset")
{
new_cmd_args.push("-lcharset".to_string());
}
if let Some(ref sdkroot) = Self::macos_sdk_root() {
new_cmd_args.extend_from_slice(&[
format!("--sysroot={}", sdkroot.display()),
"-isystem".to_string(),
format!("{}", sdkroot.join("usr").join("include").display()),
format!("-L{}", sdkroot.join("usr").join("lib").display()),
Expand Down

0 comments on commit af3a2ab

Please sign in to comment.