Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
eugenehp committed Jun 6, 2024
1 parent 118ece5 commit 51d5696
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,24 +174,23 @@ fn build(sdk_path: Option<&str>, target: &str) {
.map(|h| format!("#include <{}>\n", h))
.collect();


let fixes = if target.contains("apple-visionos") {
vec![
// /Applications/Xcode.app/Contents/Developer/Platforms/XROS.platform/Developer/SDKs/XROS1.1.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.h:43:11: fatal error: 'AudioToolbox/AudioFileComponent.h' file not found
"#define TARGET_OS_IPHONE true\n",
// https://github.com/phracker/MacOSX-SDKs/blob/master/MacOSX10.13.sdk/usr/include/MacTypes.h#L289
// /Applications/Xcode.app/Contents/Developer/Platforms/XROS.platform/Developer/SDKs/XROS1.1.sdk/System/Library/Frameworks/CoreMIDI.framework/Headers/MIDIServices.h:1633:8: error: unknown type name 'ItemCount'
"typedef unsigned long ItemCount;\n",
"typedef unsigned long ByteCount;\n"
"typedef unsigned long ByteCount;\n",
]
}else {
} else {
vec![""]
};

let contents = format!("{}{}", fixes.concat(), meta_header.concat());

println!("=============================");
println!("{}",&contents);
println!("{}", &contents);
println!("=============================");

builder = builder.header_contents("coreaudio.h", &contents);
Expand All @@ -209,7 +208,10 @@ fn build(sdk_path: Option<&str>, target: &str) {

fn main() {
let target = std::env::var("TARGET").unwrap();
if !(target.contains("apple-darwin") || target.contains("apple-ios") || target.contains("apple-visionos")) {
if !(target.contains("apple-darwin")
|| target.contains("apple-ios")
|| target.contains("apple-visionos"))
{
panic!("coreaudio-sys requires macos or ios or visionos target");
}

Expand Down

0 comments on commit 51d5696

Please sign in to comment.