From 23173ae2c7dfc4d0a86092c7c118f6852aedea4c Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 26 Oct 2009 21:52:11 +0000 Subject: Cleanup. svn-id: r45421 --- tools/create_msvc/create_msvc.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'tools/create_msvc/create_msvc.cpp') diff --git a/tools/create_msvc/create_msvc.cpp b/tools/create_msvc/create_msvc.cpp index 47f9a6bdbc..8cfed79ebf 100644 --- a/tools/create_msvc/create_msvc.cpp +++ b/tools/create_msvc/create_msvc.cpp @@ -144,13 +144,11 @@ int main(int argc, char *argv[]) { for (EngineDescList::iterator j = setup.engines.begin(); j != setup.engines.end(); ++j) j->enable = true; } else if (!setEngineBuildState(name, setup.engines, true)) { - FeatureList::iterator feature = std::find(setup.features.begin(), setup.features.end(), name); - if (feature == setup.features.end()) { + // If none found, we'll try the features list + if (!setFeatureBuildState(name, setup.features, true)) { std::cerr << "ERROR: \"" << name << "\" is neither an engine nor a feature!\n"; return -1; } - - feature->enable = true; } } else if (!strncmp(argv[i], "--disable-", 10)) { const char *name = &argv[i][10]; @@ -164,13 +162,10 @@ int main(int argc, char *argv[]) { j->enable = false; } else if (!setEngineBuildState(name, setup.engines, false)) { // If none found, we'll try the features list - FeatureList::iterator feature = std::find(setup.features.begin(), setup.features.end(), name); - if (feature == setup.features.end()) { + if (!setFeatureBuildState(name, setup.features, false)) { std::cerr << "ERROR: \"" << name << "\" is neither an engine nor a feature!\n"; return -1; } - - feature->enable = false; } } else if (!strcmp(argv[i], "--file-prefix")) { if (i + 1 >= argc) { @@ -542,6 +537,16 @@ StringList getFeatureLibraries(const FeatureList &features) { return libraries; } +bool setFeatureBuildState(const std::string &name, FeatureList &features, bool enable) { + FeatureList::iterator i = std::find(features.begin(), features.end(), name); + if (i != features.end()) { + i->enable = enable; + return true; + } else { + return false; + } +} + namespace { typedef std::map UUIDMap; -- cgit v1.2.3