CREATE_PROJECT: Disable engines for which required features are not available
This commit is contained in:
parent
14dcdb6103
commit
2f4d14aba5
2 changed files with 26 additions and 2 deletions
|
@ -301,6 +301,19 @@ int main(int argc, char *argv[]) {
|
|||
j->enable = false;
|
||||
}
|
||||
|
||||
// Disable engines for which we are missing dependencies
|
||||
for (EngineDescList::const_iterator i = setup.engines.begin(); i != setup.engines.end(); ++i) {
|
||||
if (i->enable) {
|
||||
for (StringList::const_iterator ef = i->requiredFeatures.begin(); ef != i->requiredFeatures.end(); ++ef) {
|
||||
FeatureList::iterator feature = std::find(setup.features.begin(), setup.features.end(), *ef);
|
||||
if (feature != setup.features.end() && !feature->enable) {
|
||||
setEngineBuildState(i->name, setup.engines, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Print status
|
||||
cout << "Enabled engines:\n\n";
|
||||
for (EngineDescList::const_iterator i = setup.engines.begin(); i != setup.engines.end(); ++i) {
|
||||
|
@ -906,7 +919,7 @@ namespace {
|
|||
*/
|
||||
bool parseEngine(const std::string &line, EngineDesc &engine) {
|
||||
// Format:
|
||||
// add_engine engine_name "Readable Description" enable_default ["SubEngineList"]
|
||||
// add_engine engine_name "Readable Description" enable_default ["SubEngineList"] ["base games"] ["dependencies"]
|
||||
TokenList tokens = tokenize(line);
|
||||
|
||||
if (tokens.size() < 4)
|
||||
|
@ -921,8 +934,14 @@ bool parseEngine(const std::string &line, EngineDesc &engine) {
|
|||
engine.name = *token; ++token;
|
||||
engine.desc = *token; ++token;
|
||||
engine.enable = (*token == "yes"); ++token;
|
||||
if (token != tokens.end())
|
||||
if (token != tokens.end()) {
|
||||
engine.subEngines = tokenize(*token);
|
||||
++token;
|
||||
if (token != tokens.end())
|
||||
++token;
|
||||
if (token != tokens.end())
|
||||
engine.requiredFeatures = tokenize(*token);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -87,6 +87,11 @@ struct EngineDesc {
|
|||
*/
|
||||
bool enable;
|
||||
|
||||
/**
|
||||
* Features required for this engine.
|
||||
*/
|
||||
StringList requiredFeatures;
|
||||
|
||||
/**
|
||||
* A list of all available sub engine names. Sub engines are engines
|
||||
* which are built on top of an existing engines and can be only
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue