| 1198 | } |
| 1199 | |
| 1200 | void cmGlobalVisualStudioGenerator::GenerateSolution( |
| 1201 | cmLocalGenerator const* root, |
| 1202 | std::vector<cmLocalGenerator*> const& generators) |
| 1203 | { |
| 1204 | if (generators.empty()) { |
| 1205 | return; |
| 1206 | } |
| 1207 | |
| 1208 | // Collect all targets under this root generator and the transitive |
| 1209 | // closure of their dependencies. |
| 1210 | TargetDependSet const projectTargets = |
| 1211 | this->GetTargetsForProject(root, generators); |
| 1212 | |
| 1213 | std::string fname = GetSLNFile(root); |
| 1214 | cmGeneratedFileStream fout(fname); |
| 1215 | fout.SetCopyIfDifferent(true); |
| 1216 | if (!fout) { |
| 1217 | return; |
| 1218 | } |
| 1219 | |
| 1220 | cm::VS::Solution const solution = this->CreateSolution(root, projectTargets); |
| 1221 | if (this->Version >= cmGlobalVisualStudioGenerator::VSVersion::VS18) { |
| 1222 | WriteSlnx(fout, solution); |
| 1223 | } else { |
| 1224 | WriteSln(fout, solution); |
| 1225 | } |
| 1226 | |
| 1227 | if (fout.Close()) { |
| 1228 | this->FileReplacedDuringGenerate(fname); |
| 1229 | } |
| 1230 | } |
no test coverage detected