]> git.tdb.fi Git - builder.git/commitdiff
Replace the stdc++ library with gnustl_static on Android
authorMikko Rasa <tdb@tdb.fi>
Thu, 29 Dec 2022 16:33:58 +0000 (18:33 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 29 Dec 2022 16:33:58 +0000 (18:33 +0200)
plugins/android/androidcompiler.cpp

index b9d7add0840c2d18e647a305812576b2db166948..e1babc6bcf7db94209ffa01361d08459e5bd2988 100644 (file)
@@ -1,6 +1,7 @@
 #include <msp/builder/builder.h>
 #include <msp/builder/externaltask.h>
 #include <msp/builder/filetarget.h>
+#include <msp/core/algorithm.h>
 #include <msp/fs/dir.h>
 #include <msp/fs/stat.h>
 #include <msp/fs/utils.h>
@@ -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);