Skip to content

Commit 5843ee5

Browse files
authored
bindings/c: Fix Android build (#2163)
Fixes the following build failure: ``` -- Configuring incomplete, errors occurred! --- stderr [libsql-ffi/build.rs:462:9] format!("{BUNDLED_DIR}/SQLite3MultipleCiphers") = "bundled/SQLite3MultipleCiphers" CMake Error at /opt/homebrew/share/cmake/Modules/Platform/Android-Determine.cmake:217 (message): Android: Neither the NDK or a standalone toolchain was found. Call Stack (most recent call first): /opt/homebrew/share/cmake/Modules/CMakeDetermineSystem.cmake:191 (include) CMakeLists.txt:2 (project) CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. thread 'main' panicked at /Users/penberg/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/cmake-0.1.54/src/lib.rs:1119:5: command did not execute successfully, got: exit status: 1 build script failed, must exit now note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ```
2 parents 76e5772 + 0f54825 commit 5843ee5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libsql-ffi/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,10 @@ fn build_multiple_ciphers(out_path: &Path) -> PathBuf {
487487
.define("CMAKE_POSITION_INDEPENDENT_CODE", "ON")
488488
.profile("Release");
489489

490+
if let Ok(ndk_home) = env::var("ANDROID_NDK_HOME") {
491+
config.define("CMAKE_ANDROID_NDK", ndk_home);
492+
}
493+
490494
if let Ok(cc) = env::var("CMAKE_C_COMPILER") {
491495
let mut build = cc::Build::new();
492496
build.compiler(cc);

0 commit comments

Comments
 (0)