summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-14 16:18:51 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-14 16:21:08 (GMT)
commit8ba6dc362dd1c5b073c68f8a873a91ddd2743e34 (patch)
tree33d992413dc2c6cb23c043032b4794a6171835bd /Source
parent1d04d2ce3609da4c4f8d59ccfabd8848a6e765d4 (diff)
downloadCMake-8ba6dc362dd1c5b073c68f8a873a91ddd2743e34.zip
CMake-8ba6dc362dd1c5b073c68f8a873a91ddd2743e34.tar.gz
CMake-8ba6dc362dd1c5b073c68f8a873a91ddd2743e34.tar.bz2
VS: Place CMAKE_<LANG>_STANDARD_LIBRARIES after other libraries
Make the VS generator consistent with the Ninja and Makefile generators that place the libraries listed in this variable after other libraries on the link command line. These system libraries never depend on the project libraries.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index a60222e..f084e19 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2781,13 +2781,6 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
flags += " ";
flags += flagsConfig;
}
- std::string standardLibsVar = "CMAKE_";
- standardLibsVar += linkLanguage;
- standardLibsVar += "_STANDARD_LIBRARIES";
- std::string const libs =
- this->Makefile->GetSafeDefinition(standardLibsVar.c_str());
- std::vector<std::string> libVec;
- cmSystemTools::ParseWindowsCommandLine(libs.c_str(), libVec);
cmComputeLinkInformation* pcli =
this->GeneratorTarget->GetLinkInformation(config.c_str());
@@ -2797,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