| 1459 | } |
| 1460 | |
| 1461 | cmIDEFlagTable const* cmGlobalVisualStudio10Generator::LoadFlagTable( |
| 1462 | std::string const& toolSpecificName, std::string const& defaultName, |
| 1463 | std::string const& table) const |
| 1464 | { |
| 1465 | cmMakefile* mf = this->GetCurrentMakefile(); |
| 1466 | |
| 1467 | std::string filename; |
| 1468 | if (!toolSpecificName.empty()) { |
| 1469 | if (cm::optional<std::string> found = |
| 1470 | this->FindFlagTable(toolSpecificName, table)) { |
| 1471 | filename = std::move(*found); |
| 1472 | } else { |
| 1473 | mf->IssueMessage(MessageType::FATAL_ERROR, |
| 1474 | cmStrCat("JSON flag table for ", table, |
| 1475 | " not found for toolset ", toolSpecificName)); |
| 1476 | return nullptr; |
| 1477 | } |
| 1478 | } else { |
| 1479 | std::string const& genericName = |
| 1480 | this->CanonicalToolsetName(this->GetPlatformToolsetString()); |
| 1481 | cm::optional<std::string> found = this->FindFlagTable(genericName, table); |
| 1482 | if (!found) { |
| 1483 | found = this->FindFlagTable(defaultName, table); |
| 1484 | } |
| 1485 | if (found) { |
| 1486 | filename = std::move(*found); |
| 1487 | } else { |
| 1488 | mf->IssueMessage(MessageType::FATAL_ERROR, |
| 1489 | cmStrCat("JSON flag table for ", table, |
| 1490 | " not found for toolset ", genericName, ' ', |
| 1491 | defaultName)); |
| 1492 | return nullptr; |
| 1493 | } |
| 1494 | } |
| 1495 | |
| 1496 | cm::optional<std::string> vsVer = this->GetVSInstanceVersion(); |
| 1497 | if (cmIDEFlagTable const* ret = cmLoadFlagTableJson(filename, vsVer)) { |
| 1498 | return ret; |
| 1499 | } |
| 1500 | |
| 1501 | mf->IssueMessage( |
| 1502 | MessageType::FATAL_ERROR, |
| 1503 | cmStrCat("JSON flag table could not be loaded:\n ", filename)); |
| 1504 | return nullptr; |
| 1505 | } |
| 1506 | |
| 1507 | cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetClFlagTable() const |
| 1508 | { |
nothing calls this directly
no test coverage detected