Skip to content

Commit b4f37c8

Browse files
committed
apply static-stdcxx config for android on the mtmd_build config too
1 parent bc94489 commit b4f37c8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llama-cpp-sys-2/build.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,12 @@ fn main() {
10311031
configure_emscripten_cc(&mut mtmd_build);
10321032
}
10331033

1034+
// When static-stdcxx is enabled on Android, suppress the cc crate's automatic
1035+
// C++ stdlib linking (which defaults to c++_shared) so we can link c++_static instead.
1036+
if matches!(target_os, TargetOs::Android) && cfg!(feature = "static-stdcxx") {
1037+
mtmd_build.cpp_link_stdlib(None);
1038+
}
1039+
10341040
// Collect all .cpp files in tools/mtmd and its subdirectories
10351041
for entry in glob(mtmd_src.join("**/*.cpp").to_str().unwrap()).unwrap() {
10361042
match entry {

0 commit comments

Comments
 (0)