aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald Kinard <[email protected]>2015-09-18 00:08:22 -0500
committerRonald Kinard <[email protected]>2015-09-18 00:08:22 -0500
commit18311dba869b1296c5d02bdfc02f2287c45e6c11 (patch)
treeaca21fe8c0bfd8658c93a655ab54400f802066f2
parentOverhaul Apt service. (diff)
downloadctru-rs-18311dba869b1296c5d02bdfc02f2287c45e6c11.tar.xz
ctru-rs-18311dba869b1296c5d02bdfc02f2287c45e6c11.zip
Fix build script.
-rw-r--r--build.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/build.rs b/build.rs
index 05d4cab..6b07e4e 100644
--- a/build.rs
+++ b/build.rs
@@ -4,12 +4,11 @@ use std::fs;
use std::option::Option::{self, Some, None};
-const ENV_DKP: &'static str = "DEVKITPRO";
+const ENV_DKP: &'static str = "CTRULIB";
fn find_libctru() -> Option<PathBuf> {
if let Ok(value) = env::var(ENV_DKP) {
let mut path = PathBuf::from(value);
- path.push("libctru");
path.push("lib");
// metadata returns Err if the dir does not exist
if let Ok(metadata) = fs::metadata(path.as_path()) {
@@ -24,7 +23,14 @@ fn find_libctru() -> Option<PathBuf> {
fn main() {
if let Some(path) = find_libctru() {
if let Some(s) = path.to_str() {
- println!("cargo:rustc-link-search={}", s);
+ println!("cargo:rustc-link-lib=static=ctru");
+ println!("cargo:rustc-link-search=native={}", s);
+ } else {
+ println!("path is not a valid string");
+ std::process::exit(1);
}
+ } else {
+ println!("could not find libctru");
+ std::process::exit(1);
}
}