forked from libretro-rs/libretro-rs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
14f3008
commit 90b72a8
Showing
12 changed files
with
4,124 additions
and
4,467 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "libretro-rs-sys" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
libc = "0.2" | ||
|
||
[build-dependencies] | ||
bindgen = "0.59" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# libretro-rs-sys | ||
|
||
Raw API bindings for `libretro.h`, minus the forward declarations for functions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
extern crate bindgen; | ||
|
||
use std::env; | ||
use std::path::PathBuf; | ||
|
||
const LIBRETRO_HEADER_FILE: &'static str = "include/libretro.h"; | ||
|
||
fn main() { | ||
println!("cargo:rerun-if-changed={}", LIBRETRO_HEADER_FILE); | ||
|
||
let bindings = bindgen::Builder::default() | ||
.header(LIBRETRO_HEADER_FILE) | ||
.allowlist_type("^retro_.+$") | ||
.allowlist_var("^RETRO_.+$") | ||
.default_enum_style(bindgen::EnumVariation::Rust { non_exhaustive: false }) | ||
.layout_tests(false) | ||
.parse_callbacks(Box::new(bindgen::CargoCallbacks)) | ||
.generate() | ||
.expect("Unable to generate bindings"); | ||
|
||
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); | ||
bindings | ||
.write_to_file(out_path.join("libretro.rs")) | ||
.expect("Couldn't write bindings!"); | ||
} |
Oops, something went wrong.