MCPcopy Create free account
hub / github.com/Kitware/CMake / AddUnityFilesModeAuto

Method AddUnityFilesModeAuto

Source/cmLocalGenerator.cxx:3183–3210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3181}
3182
3183std::vector<cmLocalGenerator::UnitySource>
3184cmLocalGenerator::AddUnityFilesModeAuto(
3185 cmGeneratorTarget* target, std::string const& lang,
3186 std::vector<std::string> const& configs,
3187 std::vector<UnityBatchedSource> const& filtered_sources,
3188 cmValue beforeInclude, cmValue afterInclude,
3189 std::string const& filename_base, UnityPathMode pathMode, size_t batchSize)
3190{
3191 if (batchSize == 0) {
3192 batchSize = filtered_sources.size();
3193 }
3194 char const* filename_prefix = unity_file_prefix(target);
3195 std::vector<UnitySource> unity_files;
3196 for (size_t itemsLeft = filtered_sources.size(), chunk, batch = 0;
3197 itemsLeft > 0; itemsLeft -= chunk, ++batch) {
3198
3199 chunk = std::min(itemsLeft, batchSize);
3200
3201 std::string filename = cmStrCat(filename_base, filename_prefix, batch,
3202 unity_file_extension(lang));
3203 auto const begin = filtered_sources.begin() + batch * batchSize;
3204 auto const end = begin + chunk;
3205 unity_files.emplace_back(this->WriteUnitySource(
3206 target, configs, cmMakeRange(begin, end), beforeInclude, afterInclude,
3207 std::move(filename), filename_base, pathMode));
3208 }
3209 return unity_files;
3210}
3211
3212std::vector<cmLocalGenerator::UnitySource>
3213cmLocalGenerator::AddUnityFilesModeGroup(

Callers

nothing calls this directly

Calls 10

WriteUnitySourceMethod · 0.95
unity_file_prefixFunction · 0.85
minFunction · 0.85
unity_file_extensionFunction · 0.85
cmMakeRangeFunction · 0.85
moveFunction · 0.85
emplace_backMethod · 0.80
cmStrCatFunction · 0.70
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected