| 3210 | } |
| 3211 | |
| 3212 | std::vector<cmLocalGenerator::UnitySource> |
| 3213 | cmLocalGenerator::AddUnityFilesModeGroup( |
| 3214 | cmGeneratorTarget* target, std::string const& lang, |
| 3215 | std::vector<std::string> const& configs, |
| 3216 | std::vector<UnityBatchedSource> const& filtered_sources, |
| 3217 | cmValue beforeInclude, cmValue afterInclude, |
| 3218 | std::string const& filename_base, UnityPathMode pathMode) |
| 3219 | { |
| 3220 | std::vector<UnitySource> unity_files; |
| 3221 | |
| 3222 | // sources organized by group name. Drop any source |
| 3223 | // without a group |
| 3224 | std::unordered_map<std::string, std::vector<UnityBatchedSource>> |
| 3225 | explicit_mapping; |
| 3226 | for (UnityBatchedSource const& ubs : filtered_sources) { |
| 3227 | if (cmValue value = ubs.Source->GetProperty("UNITY_GROUP")) { |
| 3228 | auto i = explicit_mapping.find(*value); |
| 3229 | if (i == explicit_mapping.end()) { |
| 3230 | std::vector<UnityBatchedSource> sources{ ubs }; |
| 3231 | explicit_mapping.emplace(*value, std::move(sources)); |
| 3232 | } else { |
| 3233 | i->second.emplace_back(ubs); |
| 3234 | } |
| 3235 | } |
| 3236 | } |
| 3237 | |
| 3238 | char const* filename_prefix = unity_file_prefix(target); |
| 3239 | for (auto const& item : explicit_mapping) { |
| 3240 | auto const& name = item.first; |
| 3241 | std::string filename = cmStrCat(filename_base, filename_prefix, name, |
| 3242 | unity_file_extension(lang)); |
| 3243 | unity_files.emplace_back(this->WriteUnitySource( |
| 3244 | target, configs, cmMakeRange(item.second), beforeInclude, afterInclude, |
| 3245 | std::move(filename), filename_base, pathMode)); |
| 3246 | } |
| 3247 | |
| 3248 | return unity_files; |
| 3249 | } |
| 3250 | |
| 3251 | void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target) |
| 3252 | { |
nothing calls this directly
no test coverage detected