diff options
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 6e64b1b..e623d2c 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -540,19 +540,30 @@ void cmLocalVisualStudio7Generator::FillFlagMapFromCommandFlags( std::string& flags) { std::string replace; + std::string option; while(flagTable->IDEName) { - std::string regex = "((/|-)"; - regex += flagTable->commandFlag; - regex += ")"; - cmsys::RegularExpression reg(regex.c_str()); - while(reg.find(flags)) + option.reserve(strlen(flagTable->commandFlag+2)); + // first do the - version + option.insert(0, 1, '-'); + option.append(flagTable->commandFlag); + while(flags.find(option) != flags.npos) { // replace the flag - cmSystemTools::ReplaceString(flags, reg.match(1).c_str(), ""); + cmSystemTools::ReplaceString(flags, option.c_str(), ""); // now put value into flag map flagMap[flagTable->IDEName] = flagTable->value; } + // now do the / version + option[0] = '/'; + while(flags.find(option) != flags.npos) + { + // replace the flag + cmSystemTools::ReplaceString(flags, option.c_str(), ""); + // now put value into flag map + flagMap[flagTable->IDEName] = flagTable->value; + } + // move to next flag flagTable++; } } |