cmMakefile: Implement LISTFILE_STACK property in terms of cmState.

This commit is contained in:
Stephen Kelly 2015-07-07 23:36:13 +02:00
parent 647b533bce
commit 6083ec9a78
1 changed files with 9 additions and 1 deletions

View File

@ -4282,7 +4282,15 @@ const char *cmMakefile::GetProperty(const std::string& prop,
} }
else if (prop == "LISTFILE_STACK") else if (prop == "LISTFILE_STACK")
{ {
output = cmJoin(this->ListFileStack, ";"); std::vector<std::string> listFiles;
cmState::Snapshot snp = this->StateSnapshot;
while (snp.IsValid())
{
listFiles.push_back(snp.GetExecutionListFile());
snp = snp.GetCallStackParent();
}
std::reverse(listFiles.begin(), listFiles.end());
output = cmJoin(listFiles, ";");
return output.c_str(); return output.c_str();
} }
else if ( prop == "CACHE_VARIABLES" ) else if ( prop == "CACHE_VARIABLES" )