瀏覽代碼

Merge topic 'fbuild_optimize_db'

914a9eea94 FASTBuild: optimize generated file size

Acked-by: Kitware Robot <[email protected]>
Merge-request: !11182
Brad King 1 月之前
父節點
當前提交
2d8e464d2f
共有 2 個文件被更改,包括 10 次插入7 次删除
  1. 3 5
      Source/cmFastbuildNormalTargetGenerator.cxx
  2. 7 2
      Source/cmGlobalFastbuildGenerator.cxx

+ 3 - 5
Source/cmFastbuildNormalTargetGenerator.cxx

@@ -1307,8 +1307,7 @@ cmFastbuildNormalTargetGenerator::GenerateObjects()
                                 objectListNode);
       ComputePCH(*source, objectListNode, createdPCH);
 
-      objectListNode.Name =
-        cmStrCat(language, "_ObjectGroup_", GetTargetName());
+      objectListNode.Name = cmStrCat(this->GetName(), '_', language, "_Objs");
       // TODO: Ask cmake the output objects and group by extension instead
       // of doing this
       if (language == "RC") {
@@ -1325,13 +1324,12 @@ cmFastbuildNormalTargetGenerator::GenerateObjects()
     }
   }
 
-  int groupNameCount = 1;
+  int groupNameCount = 0;
 
   for (auto& val : nodesPermutations) {
     auto& objectListNode = val.second;
     objectListNode.Name =
-      cmStrCat(objectListNode.Name, "-", objectListNode.CompilerOutputPath,
-               "-", std::to_string(groupNameCount++));
+      cmStrCat(objectListNode.Name, "_", std::to_string(++groupNameCount));
     LogMessage(cmStrCat("ObjectList name: ", objectListNode.Name));
   }
 

+ 7 - 2
Source/cmGlobalFastbuildGenerator.cxx

@@ -1155,8 +1155,13 @@ void cmGlobalFastbuildGenerator::WriteExec(FastbuildExecNode const& Exec,
   }
   Indent(indent);
   *BuildFileStream << "}\n";
-  WriteAlias(Exec.OutputsAlias);
-  WriteAlias(Exec.ByproductsAlias);
+  static bool const verbose = GlobalSettingIsOn(FASTBUILD_VERBOSE_GENERATOR) ||
+    cmSystemTools::HasEnv(FASTBUILD_VERBOSE_GENERATOR);
+  // Those aliases are only used for troubleshooting the generated file.
+  if (verbose) {
+    WriteAlias(Exec.OutputsAlias);
+    WriteAlias(Exec.ByproductsAlias);
+  }
 }
 
 void cmGlobalFastbuildGenerator::WriteObjectList(