Skip to content

Commit bd6e949

Browse files
committed
allow building on macos
Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 844d640 commit bd6e949

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎framework_lib/src/esrt/mod.rs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,12 @@ pub fn get_esrt() -> Option<Esrt> {
532532
Some(esrt_table)
533533
}
534534

535+
/// macOS doesn't expose the ESRT
536+
#[cfg(target_os = "macos")]
537+
pub fn get_esrt() -> Option<Esrt> {
538+
None
539+
}
540+
535541
#[cfg(target_os = "freebsd")]
536542
#[repr(C)]
537543
pub struct EfiGetTableIoc {

‎framework_lib/src/smbios.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@ pub fn get_smbios() -> Option<SmbiosStore> {
316316
SmbiosStore::from_table_data(table_data, major, minor)
317317
}
318318

319+
/// Not a Framework system, there's no point in reading SMBIOS on macOS
320+
#[cfg(target_os = "macos")]
321+
pub fn get_smbios() -> Option<SmbiosStore> {
322+
trace!("get_smbios() macos entry");
323+
None
324+
}
325+
319326
#[cfg(target_os = "freebsd")]
320327
fn kenv_get(name: &str) -> nix::Result<String> {
321328
use libc::{c_int, KENV_GET, KENV_MVALLEN};

0 commit comments

Comments
 (0)