Skip to content

Commit

Permalink
Define ANDROID_NDK CMake variable when building for Android
Browse files Browse the repository at this point in the history
Versions of SDL since commit 5b65e0af01873e26673c11da43001e7075986290
fail to build if this isn't set. Let's take the value from the
ANDROID_NDK_HOME environment variable, which seems to be the standard.
  • Loading branch information
hikari-no-yume committed May 6, 2023
1 parent 27cd1fd commit 15c58be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdl2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ fn compile_sdl2(sdl2_build_path: &Path, target_os: &str) -> PathBuf {
cfg.define("VIDEO_OPENGLES", "OFF");
}

if target_os == "android" {
cfg.define("ANDROID_NDK", env::var("ANDROID_NDK_HOME").expect("ANDROID_NDK_HOME environment variable must be set when compiling for Android"));
}

if cfg!(feature = "static-link") {
cfg.define("SDL_SHARED", "OFF");
cfg.define("SDL_STATIC", "ON");
Expand Down

0 comments on commit 15c58be

Please sign in to comment.