Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ jobs:
tools: cargo-ndk
token: ${{ secrets.GITHUB_TOKEN }}

- run: cargo ndk -t ${{ matrix.target }} test --no-run
- run: cargo ndk --bindgen -t ${{ matrix.target }} test --no-run

- env:
TARGET: ${{ matrix.target }}
Expand Down
15 changes: 4 additions & 11 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::env;
const BINDINGS: &str = "bindings.rs";

#[cfg(feature = "gecko")]
fn clang_args(_target_os: &str) -> Vec<String> {
fn clang_args() -> Vec<String> {
use mozbuild::{config::BINDGEN_SYSTEM_FLAGS, TOPOBJDIR};

let mut flags: Vec<String> = BINDGEN_SYSTEM_FLAGS.iter().map(|s| s.to_string()).collect();
Expand All @@ -30,15 +30,8 @@ fn clang_args(_target_os: &str) -> Vec<String> {
}

#[cfg(not(feature = "gecko"))]
fn clang_args(target_os: &str) -> Vec<String> {
match target_os {
"android" => {
let sysroot =
env::var("CARGO_NDK_SYSROOT_PATH").expect("CARGO_NDK_SYSROOT_PATH was not set");
vec![format!("--sysroot={sysroot}")]
}
_ => Vec::new(),
}
const fn clang_args() -> Vec<String> {
Vec::new()
}

fn bindgen() {
Expand Down Expand Up @@ -72,7 +65,7 @@ fn bindgen() {
};

let bindings = bindings
.clang_args(clang_args(&target_os))
.clang_args(clang_args())
// Tell cargo to invalidate the built crate whenever any of the
// included header files changed.
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
Expand Down