summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio12Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-08 20:25:23 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-15 13:15:37 (GMT)
commitf773933f2630a17ce6b3b2aa6f8d7d8b65eb336c (patch)
tree5efd0ff7844eadfdf37c045bba5c8ea09e967aa8 /Source/cmGlobalVisualStudio12Generator.cxx
parentd9e2b9a909b5f5b51ef3a106ed1d60a8d4cb795a (diff)
downloadCMake-f773933f2630a17ce6b3b2aa6f8d7d8b65eb336c.zip
CMake-f773933f2630a17ce6b3b2aa6f8d7d8b65eb336c.tar.gz
CMake-f773933f2630a17ce6b3b2aa6f8d7d8b65eb336c.tar.bz2
VS: Refactor generator toolset parsing
We parse `CMAKE_GENERATOR_TOOLSET` values of the forms: * `toolset` * `toolset,host=x64` * `host=x64` Generalize the parsing to support the forms: * `toolset` * `toolset[,key=value]*` * `key=value[,key=value]*` Disallow duplicate keys. Require all but the first field to be of `key=value` form.
Diffstat (limited to 'Source/cmGlobalVisualStudio12Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio12Generator.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx
index 2656dcc..de62ff0 100644
--- a/Source/cmGlobalVisualStudio12Generator.cxx
+++ b/Source/cmGlobalVisualStudio12Generator.cxx
@@ -109,19 +109,15 @@ bool cmGlobalVisualStudio12Generator::MatchesGeneratorName(
return false;
}
-bool cmGlobalVisualStudio12Generator::ParseGeneratorToolset(
- std::string const& ts, cmMakefile* mf)
+bool cmGlobalVisualStudio12Generator::ProcessGeneratorToolsetField(
+ std::string const& key, std::string const& value)
{
- std::string::size_type ts_end = ts.size();
- if (cmHasLiteralSuffix(ts, ",host=x64")) {
+ if (key == "host" && value == "x64") {
this->GeneratorToolsetHostArchitecture = "x64";
- ts_end -= 9;
- } else if (ts == "host=x64") {
- this->GeneratorToolsetHostArchitecture = "x64";
- ts_end = 0;
+ return true;
}
- return this->cmGlobalVisualStudio11Generator::ParseGeneratorToolset(
- ts.substr(0, ts_end), mf);
+ return this->cmGlobalVisualStudio11Generator::ProcessGeneratorToolsetField(
+ key, value);
}
bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf)