Skip to content

Commit

Permalink
fix: mac-sys-info not loaded on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
yhara committed Jul 28, 2023
1 parent 70ce4ee commit e80cf55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ env_logger = "0.8.2"
log = "0.4.11"
serde = { version = "1.0.125", features = ["derive"] }
serde_json = "1.0"
mac-sys-info = { version = "0.1.13", optional = true }
[target.'cfg(target_os = "macos")'.dependencies]
mac-sys-info = { version = "0.1.13" }

chrono = "0.4"
chrono-tz = "0.8"
4 changes: 2 additions & 2 deletions src/targets.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Returns default `TargetTriple`
#[cfg(feature = "mac")]
#[cfg(target_os = "macos")]
pub fn default_triple() -> inkwell::targets::TargetTriple {
if let Ok(info) = mac_sys_info::get_mac_sys_info() {
// #281: get_default_triple returns `darwin` but clang shows warning for it
Expand All @@ -15,7 +15,7 @@ pub fn default_triple() -> inkwell::targets::TargetTriple {
}
}

#[cfg(not(feature = "mac"))]
#[cfg(not(target_os = "macos"))]
pub fn default_triple() -> inkwell::targets::TargetTriple {
inkwell::targets::TargetMachine::get_default_triple()
}

0 comments on commit e80cf55

Please sign in to comment.