Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Update to nightly-2019-01-16 #77

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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 .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: rust

rust:
- nightly-2018-08-18
- nightly-2019-01-16

install:
- set -eo pipefail
Expand Down
12 changes: 12 additions & 0 deletions citro2d-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "citro3d-sys"
version = "0.1.0"
authors = ["Charlotte D. <[email protected]>"]

[dependencies.libc]
version = "0.2.43"
default-features = false
optional = true

[features]
default = ["libc"]
39 changes: 39 additions & 0 deletions citro2d-sys/bindgen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

clang_version=$1

if [ -z "$clang_version" ]; then
echo " usage: ./bindgen.sh <clang_version>"
echo "example: ./bindgen.sh 5.0.0"
echo "Check your current version with \`clang -v\`."
exit 1
fi

set -euxo pipefail

bindgen "$DEVKITPRO/libctru/include/citro2d.h" \
--rust-target nightly \
--use-core \
--distrust-clang-mangling \
--no-doc-comments \
--no-layout-tests \
--ctypes-prefix "::libc" \
--no-prepend-enum-name \
--generate "functions,types,vars" \
--blacklist-type "u(8|16|32|64)" \
--blacklist-type "__builtin_va_list" \
--blacklist-type "__va_list" \
-- \
--target=arm-none-eabi \
--sysroot=$DEVKITARM/arm-none-eabi \
-isystem$DEVKITARM/arm-none-eabi/include \
-isystem/usr/lib/clang/$clang_version/include \
-I$DEVKITPRO/libctru/include \
-mfloat-abi=hard \
-march=armv6k \
-mtune=mpcore \
-mfpu=vfp \
-DARM11 \
-D_3DS \
> src/bindings.rs

12 changes: 12 additions & 0 deletions citro2d-sys/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use std::env;

fn main() {
let dkp_path = env::var("DEVKITPRO").unwrap();

println!("cargo:rustc-link-search=native={}/libctru/lib", dkp_path);
println!("cargo:rustc-link-lib=static={}", match env::var("PROFILE").unwrap().as_str() {
"debug" => "citro2dd",
_ => "citro2d",
});
}

Loading