more changes
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user