Browse Source

Include gcc libdir when building

Assume devkitARM ships with only a single version, so then find the
first entry matching `${DEVKITARM}/lib/gcc/arm-none-eabi/*/include` and add it
to the -isystem includes.
pull/26/head
Ian Chamberlain 1 year ago
parent
commit
97f4835c17
No known key found for this signature in database
GPG Key ID: AE5484D09405AA60
  1. 3
      citro3d-sys/Cargo.toml
  2. 14
      citro3d-sys/build.rs

3
citro3d-sys/Cargo.toml

@ -1,9 +1,10 @@ @@ -1,9 +1,10 @@
[package]
name = "citro3d-sys"
version = "0.1.0"
authors = [ "Rust3DS Org", "panicbit <panicbit.dev@gmail.com>" ]
authors = ["Rust3DS Org", "panicbit <panicbit.dev@gmail.com>"]
edition = "2021"
license = "Zlib"
links = "citro3d"
[dependencies]
libc = "0.2.116"

14
citro3d-sys/build.rs

@ -42,6 +42,18 @@ fn main() { @@ -42,6 +42,18 @@ fn main() {
let system_include = sysroot.join("include");
let static_fns_path = Path::new("citro3d_statics_wrapper");
let gcc_dir = PathBuf::from_iter([devkitarm.as_str(), "lib", "gcc", "arm-none-eabi"]);
let gcc_include = gcc_dir
.read_dir()
.unwrap()
// Assuming that there is only one gcc version of libs under the devkitARM dir
.next()
.unwrap()
.unwrap()
.path()
.join("include");
let bindings = Builder::default()
.header(three_ds_h.to_str().unwrap())
.header(citro3d_h.to_str().unwrap())
@ -70,6 +82,8 @@ fn main() { @@ -70,6 +82,8 @@ fn main() {
sysroot.to_str().unwrap(),
"-isystem",
system_include.to_str().unwrap(),
"-isystem",
gcc_include.to_str().unwrap(),
"-I",
include_path.to_str().unwrap(),
"-mfloat-abi=hard",

Loading…
Cancel
Save