Skip to content

Commit

Permalink
fix: set bindgen target Rust version
Browse files Browse the repository at this point in the history
This addresses two potential issues:

- First, because bindgen bindings may have different size and alignment
  on different platforms, asserting them at compile time breaks
  cross-platform compatibility. Therefore, we want to be able to defer
  such assertions to the runtime, so the same bindings code is reusable
  accross platforms.
- Second, this shields us against bindgen silently introducing undesired
  MSRV bumps.
  • Loading branch information
AlexTMjugador committed Nov 28, 2024
1 parent 96be622 commit 4cb5cf2
Show file tree
Hide file tree
Showing 5 changed files with 976 additions and 342 deletions.
4 changes: 4 additions & 0 deletions packages/aotuv_lancer_vorbis_sys/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
use std::{env, env::current_dir};

#[cfg(feature = "build-time-bindgen")]
use bindgen::RustTarget;

fn main() {
#[cfg(feature = "build-time-bindgen")]
let ogg_vendor_path = current_dir()
Expand Down Expand Up @@ -61,6 +64,7 @@ fn main() {
.blocklist_item("FILE")
.blocklist_item("ogg_.*")
.blocklist_item("__.*")
.rust_target(RustTarget::Stable_1_73)
.generate()
.expect("Unable to generate bindings")
.write_to_file("src/bindings.rs")
Expand Down
Loading

0 comments on commit 4cb5cf2

Please sign in to comment.