]> git.tdb.fi Git - builder.git/blobdiff - source/androidcompiler.cpp
Move version discovery back to GnuCompiler
[builder.git] / source / androidcompiler.cpp
index cdd98af34f5095dd853521535091e5b37e0fc4e8..68c4e56d2ad675a4ac64f72a492f4ff38305e78c 100644 (file)
@@ -42,38 +42,25 @@ AndroidCompiler::AndroidCompiler(Builder &b, const Architecture &a, const string
 void AndroidCompiler::do_prepare()
 {
        GnuCompiler::do_prepare();
-       if(executable && tag=="CXX")
+       if(tag=="CXX")
        {
-               ExternalTask::Arguments argv;
-               argv.push_back(executable->get_path().str());
-               argv.push_back("-dumpversion");
-
-               builder.get_logger().log("auxcommands", format("Running %s", join(argv.begin(), argv.end())));
-               string version;
-               try
-               {
-                       version = strip(ExternalTask::run_and_capture_output(argv));
-                       builder.get_logger().log("tools", format("%s version is %s", FS::basename(executable->get_path()), version));
-               }
-               catch(const runtime_error &)
-               { }
-
+               string version_str = format("%d.%d.%d", version>>16, (version>>8)&0xFF, version&0xFF);
                FS::Path libstdcxx_dir = ndk.get_root_dir()/"sources"/"cxx-stl"/"gnu-libstdc++";
                FS::Path libstdcxx_path;
                while(1)
                {
-                       libstdcxx_path = libstdcxx_dir/version;
+                       libstdcxx_path = libstdcxx_dir/version_str;
                        if(FS::exists(libstdcxx_path))
                                break;
 
-                       string::size_type dot = version.rfind('.');
+                       string::size_type dot = version_str.rfind('.');
                        if(dot==string::npos)
                        {
                                problems.push_back("C++ standard library not found");
                                return;
                        }
 
-                       version = version.substr(0, dot);
+                       version_str = version_str.substr(0, dot);
                }
 
                FS::Path public_dir = libstdcxx_path/"include";