summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-10-18 14:09:57 (GMT)
committerBrad King <brad.king@kitware.com>2016-10-25 13:19:49 (GMT)
commit584ab5285b51945e0dd523caf77342985ac97ce4 (patch)
treef11b7a945bf8dfd42e9d86bd3fa06e52e4334bae
parent2a567c68ce6605071f3e21638560493b71ed2841 (diff)
downloadCMake-584ab5285b51945e0dd523caf77342985ac97ce4.zip
CMake-584ab5285b51945e0dd523caf77342985ac97ce4.tar.gz
CMake-584ab5285b51945e0dd523caf77342985ac97ce4.tar.bz2
VS: Add internal API to get platform toolset as string
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx13
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h1
2 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 7af971e..793c605 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -339,13 +339,20 @@ void cmGlobalVisualStudio10Generator::EnableLanguage(
const char* cmGlobalVisualStudio10Generator::GetPlatformToolset() const
{
+ return this->GetPlatformToolsetString().c_str();
+}
+
+std::string const& cmGlobalVisualStudio10Generator::GetPlatformToolsetString()
+ const
+{
if (!this->GeneratorToolset.empty()) {
- return this->GeneratorToolset.c_str();
+ return this->GeneratorToolset;
}
if (!this->DefaultPlatformToolset.empty()) {
- return this->DefaultPlatformToolset.c_str();
+ return this->DefaultPlatformToolset;
}
- return 0;
+ static std::string const empty;
+ return empty;
}
const char*
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 62b8661..ba07a5b 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -48,6 +48,7 @@ public:
/** The toolset name for the target platform. */
const char* GetPlatformToolset() const;
+ std::string const& GetPlatformToolsetString() const;
/** The toolset host architecture name (e.g. x64 for 64-bit host tools). */
const char* GetPlatformToolsetHostArchitecture() const;