]> git.tdb.fi Git - builder.git/commitdiff
Avoid zeroing version of -dumpfullversion doesn't return anything
authorMikko Rasa <tdb@tdb.fi>
Mon, 26 Dec 2022 13:30:56 +0000 (15:30 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 26 Dec 2022 19:12:50 +0000 (21:12 +0200)
Clang doesn't seem to recognize it.  This is a bit of a hack and it
would be better if ClangCompiler could handle the version check somehow,
but it's not obvious how to do that.

source/gnucompiler.cpp

index a96f5a34d214faa47caa47936c25d17cd2727af8..beff9f9a5674e3735e9fe7abeb7bc98c9bcce930 100644 (file)
@@ -178,7 +178,11 @@ void GnuCompiler::prepare_version(ToolData &tool) const
        string exe_path = exe->get_path().str();
        unsigned version = query_version(exe_path, "-dumpversion");
        if(version>=0x70000)
-               version = query_version(exe_path, "-dumpfullversion");
+       {
+               unsigned v = query_version(exe_path, "-dumpfullversion");
+               if(v)
+                       version = v;
+       }
        tool.extra_data = version;
        builder.get_logger().log("tools", "%s version is %d.%d.%d", FS::basename(exe->get_path()), version>>16, (version>>8)&0xFF, version&0xFF);
 }