diff options
author | Brad King <brad.king@kitware.com> | 2017-02-15 13:24:13 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2017-02-15 13:24:13 (GMT) |
commit | 8ff87662325b2f2c216111100da03fb78bca142c (patch) | |
tree | b128671d6e1558d4e6e84866f523536fa1c2b6fa | |
parent | 6a5e5a926817f7318a2a80822aa2ce28674344f4 (diff) | |
parent | 8ba6dc362dd1c5b073c68f8a873a91ddd2743e34 (diff) | |
download | CMake-8ff87662325b2f2c216111100da03fb78bca142c.zip CMake-8ff87662325b2f2c216111100da03fb78bca142c.tar.gz CMake-8ff87662325b2f2c216111100da03fb78bca142c.tar.bz2 |
Merge topic 'vs-refactor-libs'
8ba6dc36 VS: Place CMAKE_<LANG>_STANDARD_LIBRARIES after other libraries
1d04d2ce VS: Refactor parsing of CMAKE_<LANG>_STANDARD_LIBRARIES
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index a7edc95..f084e19 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2781,25 +2781,6 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( flags += " "; flags += flagsConfig; } - std::string standardLibsVar = "CMAKE_"; - standardLibsVar += linkLanguage; - standardLibsVar += "_STANDARD_LIBRARIES"; - std::string 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); cmComputeLinkInformation* pcli = this->GeneratorTarget->GetLinkInformation(config.c_str()); @@ -2809,10 +2790,17 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( this->Name.c_str()); return false; } - // add the libraries for the target to libs string cmComputeLinkInformation& cli = *pcli; + + std::vector<std::string> libVec; std::vector<std::string> vsTargetVec; this->AddLibraries(cli, libVec, vsTargetVec); + std::string standardLibsVar = "CMAKE_"; + standardLibsVar += linkLanguage; + standardLibsVar += "_STANDARD_LIBRARIES"; + std::string const libs = + this->Makefile->GetSafeDefinition(standardLibsVar.c_str()); + cmSystemTools::ParseWindowsCommandLine(libs.c_str(), libVec); linkOptions.AddFlag("AdditionalDependencies", libVec); // Populate TargetsFileAndConfigsVec |