| 3181 | } |
| 3182 | |
| 3183 | std::vector<cmLocalGenerator::UnitySource> |
| 3184 | cmLocalGenerator::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 | |
| 3212 | std::vector<cmLocalGenerator::UnitySource> |
| 3213 | cmLocalGenerator::AddUnityFilesModeGroup( |
nothing calls this directly
no test coverage detected