From 22a855e41a66cc6d4c4c8feee5fb679daa6273a2 Mon Sep 17 00:00:00 2001 From: Fenrir Date: Thu, 13 Jul 2017 23:45:50 -0700 Subject: [PATCH] Use -lctrud for debug builds --- ctru-rs/build.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ctru-rs/build.rs b/ctru-rs/build.rs index 4a4d627..cded1d0 100644 --- a/ctru-rs/build.rs +++ b/ctru-rs/build.rs @@ -1,7 +1,11 @@ use std::env; -use std::path::PathBuf; fn main() { - let dkp_path = PathBuf::from(env::var("DEVKITPRO").unwrap()); - println!("cargo:rustc-link-search=native={}", dkp_path.join("libctru/lib").display()); + 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" => "ctrud", + _ => "ctru", + }); }