Skip to content

Commit

Permalink
chore(aotuv_lancer_vorbis_sys): get rid of hacky ogg linking directive
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTMjugador committed Nov 28, 2024
1 parent ef0dcc4 commit 1a67ddb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ and this project adheres to
- Reduced size of the autogenerated C bindings code by dropping layout tests,
which were expected to fail on non-Linux platforms anyway due to
platform-specific code generation differences.
- Removed a hacky Cargo directive in the `aotuv_lancer_vorbis_sys` build script
for linking to `libogg` in favor of letting the compiler to carry it over from
`ogg_next_sys` by adding a `extern crate ogg_next_sys` statement, which is
cleaner.

### Fixed

Expand Down
4 changes: 0 additions & 4 deletions packages/aotuv_lancer_vorbis_sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ fn main() {
.expect("Could not get current working directory")
.join("vorbis_vendor");

// libvorbis depends on libogg. libogg is built first due to our Cargo.toml dependency on ogg_next_sys,
// but the Cargo linking instructions in its build script do not affect us
println!("cargo:rustc-link-lib=static=ogg");

println!(
"cargo:rerun-if-changed={}",
vorbis_vendor_path
Expand Down
5 changes: 5 additions & 0 deletions packages/aotuv_lancer_vorbis_sys/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]

// This `extern crate` is required for the linker to honor the linker flags `ogg_next_sys` sets on
// its build script, and therefore make the Ogg library symbols available at runtime. See:
// https://doc.rust-lang.org/nightly/reference/items/extern-crates.html#r-items.extern-crate.lookup
extern crate ogg_next_sys;

use ogg_next_sys::*;

include!("bindings.rs");
Expand Down

0 comments on commit 1a67ddb

Please sign in to comment.