diff options
author | Brad King <brad.king@kitware.com> | 2017-02-14 16:15:08 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-02-14 16:15:08 (GMT) |
commit | 1d04d2ce3609da4c4f8d59ccfabd8848a6e765d4 (patch) | |
tree | 7c6e638e8b327a719279055c8e9c5db579bf0f9d /Source | |
parent | 34ce3017b530595753b5987bd0702aceded683be (diff) | |
download | CMake-1d04d2ce3609da4c4f8d59ccfabd8848a6e765d4.zip CMake-1d04d2ce3609da4c4f8d59ccfabd8848a6e765d4.tar.gz CMake-1d04d2ce3609da4c4f8d59ccfabd8848a6e765d4.tar.bz2 |
VS: Refactor parsing of CMAKE_<LANG>_STANDARD_LIBRARIES
Parse the value as a command line string just as the MS CRT would.
This makes the VS generator behavior consistent with how the string
is used by the Ninja and Makefile generators.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index a7edc95..a60222e 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2784,22 +2784,10 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( std::string standardLibsVar = "CMAKE_"; standardLibsVar += linkLanguage; standardLibsVar += "_STANDARD_LIBRARIES"; - std::string libs = + std::string const libs = this->Makefile->GetSafeDefinition(standardLibsVar.c_str()); - // Remove trailing spaces from libs - std::string::size_type pos = libs.size() - 1; - if (!libs.empty()) { - while (libs[pos] == ' ') { - pos--; - } - } - if (pos != libs.size() - 1) { - libs = libs.substr(0, pos + 1); - } - // Replace spaces in libs with ; - std::replace(libs.begin(), libs.end(), ' ', ';'); std::vector<std::string> libVec; - cmSystemTools::ExpandListArgument(libs, libVec); + cmSystemTools::ParseWindowsCommandLine(libs.c_str(), libVec); cmComputeLinkInformation* pcli = this->GeneratorTarget->GetLinkInformation(config.c_str()); |