From 584ab5285b51945e0dd523caf77342985ac97ce4 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 18 Oct 2016 10:09:57 -0400 Subject: VS: Add internal API to get platform toolset as string --- Source/cmGlobalVisualStudio10Generator.cxx | 13 ++++++++++--- Source/cmGlobalVisualStudio10Generator.h | 1 + 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; -- cgit v0.12