summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-04-12 17:27:07 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-04-12 17:27:07 (GMT)
commit100407394209e44cd8a2dae555d2424161f45a6e (patch)
tree5d7f1c7fd896ebebfa3387eb30f82016c7cd9bff /Source/cmLocalVisualStudio7Generator.cxx
parent9e4506a2d0586dacba53119bc7c651a1d16c1849 (diff)
downloadCMake-100407394209e44cd8a2dae555d2424161f45a6e.zip
CMake-100407394209e44cd8a2dae555d2424161f45a6e.tar.gz
CMake-100407394209e44cd8a2dae555d2424161f45a6e.tar.bz2
ENH: performance improvements
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx23
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++;
}
}