Skip to content

Commit

Permalink
Applied Oli Legat's changes for Visual Studio project generation for GGP
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoticbob committed Jan 22, 2020
1 parent 0877438 commit 6115824
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Source/cmVisualStudio10TargetGenerator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2906,6 +2906,8 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
const char* toolset = this->GlobalGenerator->GetPlatformToolset();
if (toolset && clangToolset.find(toolset)) {
e2.Element("ObjectFileName", "$(IntDir)%(filename).obj");
} else if (toolset && (strcmp(toolset, "Ggp_Clang") == 0)) {
// Use the VS extension's default for ObjectFileName
} else {
e2.Element("ObjectFileName", "$(IntDir)");
}
Expand Down Expand Up @@ -3854,6 +3856,8 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
const cmComputeLinkInformation& cli, std::vector<std::string>& libVec,
std::vector<std::string>& vsTargetVec, const std::string& config)
{
const char* toolset = this->GlobalGenerator->GetPlatformToolset();
bool isGgpClang = toolset && (strcmp(toolset, "Ggp_Clang") == 0);
using ItemVector = cmComputeLinkInformation::ItemVector;
ItemVector const& libs = cli.GetItems();
std::string currentBinDir =
Expand Down Expand Up @@ -3901,15 +3905,26 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
if (l.IsPath) {
std::string path = this->LocalGenerator->MaybeConvertToRelativePath(
currentBinDir, l.Value);
// Don't use relative paths with the GGP compiler.
if (isGgpClang) {
path = l.Value;
}
ConvertToWindowsSlash(path);
if (cmVS10IsTargetsFile(l.Value)) {
vsTargetVec.push_back(path);
} else {
libVec.push_back(path);
}
} else if (!l.Target ||
l.Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
libVec.push_back(l.Value);
l.Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
// If the option starts with "-l" then remove that and put the string in
// the format "libfoo.so". GGP clang automatically add "-l" and requires
// this format
if (isGgpClang && l.Value.find("-l") == 0) {
libVec.push_back("lib" + l.Value.substr(2) + ".so");
} else {
libVec.push_back(l.Value);
}
}
}
}
Expand Down

0 comments on commit 6115824

Please sign in to comment.