diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index cf43e1b..d03f8da 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -4,6 +4,7 @@ description = "A safe wrapper around smealum's ctrulib." license = "https://en.wikipedia.org/wiki/Zlib_License" name = "ctru-rs" version = "0.5.0" +links = "ctru" [lib] crate-type = ["rlib"] diff --git a/ctru-rs/build.rs b/ctru-rs/build.rs new file mode 100644 index 0000000..7e6e534 --- /dev/null +++ b/ctru-rs/build.rs @@ -0,0 +1,13 @@ +use std::env; +use std::path::PathBuf; + +fn main() { + let devkitpro_path = PathBuf::from(env::var("DEVKITPRO").unwrap()); + + println!("cargo:rustc-link-search=native={}", devkitpro_path.join("libctru/lib").display()); + println!("cargo:rustc-link-lib=static={}", match env::var("PROFILE").unwrap().as_str() { + "release" => "ctru", + "debug" => "ctrud", + _ => unreachable!(), + }); +} diff --git a/ctru-sys/Cargo.toml b/ctru-sys/Cargo.toml index b78e6b7..6dc1201 100644 --- a/ctru-sys/Cargo.toml +++ b/ctru-sys/Cargo.toml @@ -3,7 +3,6 @@ name = "ctru-sys" version = "0.4.0" authors = ["Ronald Kinard "] license = "https://en.wikipedia.org/wiki/Zlib_License" -links = "ctru" [dependencies.libc] version = "0.2" diff --git a/ctru-sys/build.rs b/ctru-sys/build.rs index a75e858..a1d5801 100644 --- a/ctru-sys/build.rs +++ b/ctru-sys/build.rs @@ -6,13 +6,6 @@ use std::path::PathBuf; fn main() { let devkitpro_path = PathBuf::from(env::var("DEVKITPRO").unwrap()); - println!("cargo:rustc-link-search=native={}", devkitpro_path.join("libctru/lib").display()); - println!("cargo:rustc-link-lib=static={}", match env::var("PROFILE").unwrap().as_str() { - "release" => "ctru", - "debug" => "ctrud", - _ => unreachable!(), - }); - let bindings = bindgen::Builder::default() .use_core() .trust_clang_mangling(false)