Added target family attribute to AVR8 TDFs and renamed AVR family attribute to avr-family

This commit is contained in:
Nav
2023-12-13 00:50:10 +00:00
parent 5dd4af6705
commit b5587d1e3c
266 changed files with 303 additions and 284 deletions

View File

@@ -27,8 +27,19 @@ namespace Targets::TargetDescription
return this->targetName;
}
const std::string& TargetDescriptionFile::getFamilyName() const {
return this->familyName;
TargetFamily TargetDescriptionFile::getFamily() const {
static const auto familiesByName = std::map<std::string, TargetFamily> {
{"AVR8", TargetFamily::AVR_8},
{"RISCV", TargetFamily::RISC_V},
};
const auto familyIt = familiesByName.find(this->familyName);
if (familyIt == familiesByName.end()) {
throw Exception("Failed to resolve target family - invalid family name");
}
return familyIt->second;
}
void TargetDescriptionFile::init(const QString& xmlFilePath) {