From bfbae0aed8eef842b39794b910f0502b4947dce0 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 29 Dec 2022 18:33:58 +0200 Subject: [PATCH] Replace the stdc++ library with gnustl_static on Android --- plugins/android/androidcompiler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/android/androidcompiler.cpp b/plugins/android/androidcompiler.cpp index b9d7add..e1babc6 100644 --- a/plugins/android/androidcompiler.cpp +++ b/plugins/android/androidcompiler.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -44,7 +45,11 @@ void AndroidCompiler::do_prepare(ToolData &tool) const CustomizedTool::do_prepare(tool); if(tag=="CXX") { - tool.build_info.libs.push_back("gnustl_static"); + auto i = find(tool.build_info.libs, "stdc++"); + if(i!=tool.build_info.libs.end()) + *i = "gnustl_static"; + else + tool.build_info.libs.push_back("gnustl_static"); unsigned version = tool.extra_data; string version_str = format("%d.%d.%d", version>>16, (version>>8)&0xFF, version&0xFF); -- 2.45.2