more changes

This commit is contained in:
2026-09-07 21:50:29 -06:00
parent 6fedc1fb81
commit ac0e784047
2 changed files with 5 additions and 9 deletions
+4 -1
View File
@@ -7,11 +7,14 @@ namespace kmake {
Distro::~Distro() {} Distro::~Distro() {}
optional<string> Distro::getVar(const string& name) { optional<string> Distro::getVar(const string& name) {
// find distro var
auto it = vars.find(name); auto it = vars.find(name);
if (it != vars.end()) { if (it != vars.end()) {
return it->second; return it->second;
} }
return {};
// check if project has it
return project->getVar(name);
} }
} }
+1 -8
View File
@@ -285,14 +285,7 @@ namespace kmake {
} }
Distro& Project::getDistro(const string& distro_name) { Distro& Project::getDistro(const string& distro_name) {
auto it = distros.find(distro_name); return distros.find(distro_name)->second;
if (it != distros.end()) {
return it->second;
}
// Return reference to first distro if exists, otherwise create a default
// This should not happen if hasDistro is checked first
static Distro empty_distro;
return empty_distro;
} }
optional<string> Project::getVar(const string& var_name) { optional<string> Project::getVar(const string& var_name) {