Skip to content

Commit

Permalink
Fix build on windows (Kernel-SU#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
5ec1cff authored Mar 13, 2023
1 parent 8d5699a commit c9f2b62
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion binder_ndk_sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ use std::env;
use std::io::Write;
use std::path::PathBuf;

#[cfg(target_os = "windows")]
const BUILD_EXT: &str = ".cmd";
#[cfg(not(target_os = "windows"))]
const BUILD_EXT: &str = "";

fn build_stub(){
let symbols = std::fs::read_to_string("src/symbols.txt").unwrap();
let mut f = std::fs::File::create("src/libbinder_ndk/jni/stub.c").unwrap();
Expand All @@ -16,7 +21,7 @@ fn build_stub(){
f.flush().unwrap();

let ndk_path = env::var("ANDROID_NDK_HOME").expect("Please set ANDROID_NDK_HOME");
let ndk_build_path = format!("{}/ndk-build", ndk_path);
let ndk_build_path = format!("{}/ndk-build{}", ndk_path, BUILD_EXT);

std::process::Command::new(ndk_build_path)
.current_dir("src/libbinder_ndk")
Expand Down

0 comments on commit c9f2b62

Please sign in to comment.