Skip to content

Commit 5d50ff0

Browse files
committed
apply static-stdcxx config for android on the mtmd_build config too
1 parent 32efc81 commit 5d50ff0

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
@@ -843,6 +843,12 @@ fn main() {
843843
mtmd_build.flag("/std:c++17");
844844
}
845845

846+
// When static-stdcxx is enabled on Android, suppress the cc crate's automatic
847+
// C++ stdlib linking (which defaults to c++_shared) so we can link c++_static instead.
848+
if matches!(target_os, TargetOs::Android) && cfg!(feature = "static-stdcxx") {
849+
mtmd_build.cpp_link_stdlib(None);
850+
}
851+
846852
// Collect all .cpp files in tools/mtmd and its subdirectories
847853
for entry in glob(mtmd_src.join("**/*.cpp").to_str().unwrap()).unwrap() {
848854
match entry {

0 commit comments

Comments
 (0)