diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-05-23 18:41:46 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2014-06-05 16:44:04 (GMT) |
commit | d46c650d676420a3053ba39e7af8808d581d04ab (patch) | |
tree | e25c57afe9794bf3c48b5b20ff8658b34cbc0103 /Source/cmMakefile.cxx | |
parent | 88818b680549651b6531a6648396d749b759afb2 (diff) | |
download | CMake-d46c650d676420a3053ba39e7af8808d581d04ab.zip CMake-d46c650d676420a3053ba39e7af8808d581d04ab.tar.gz CMake-d46c650d676420a3053ba39e7af8808d581d04ab.tar.bz2 |
cmMakefile: return a backtrace
This allows backtraces to be fully controlled by the makefile rather
than externally (and makes changing how they are manipulated easier).
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 2620471..b22ff87 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -317,7 +317,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t, { this->CallStack.back().Status->SetNestedError(true); } - this->GetBacktrace(backtrace); + backtrace = this->GetBacktrace(); } else { @@ -348,12 +348,9 @@ void cmMakefile::IssueMessage(cmake::MessageType t, } //---------------------------------------------------------------------------- -bool cmMakefile::GetBacktrace(cmListFileBacktrace& backtrace) const +cmListFileBacktrace cmMakefile::GetBacktrace() const { - if(this->CallStack.empty()) - { - return false; - } + cmListFileBacktrace backtrace; for(CallStackType::const_reverse_iterator i = this->CallStack.rbegin(); i != this->CallStack.rend(); ++i) { @@ -362,7 +359,7 @@ bool cmMakefile::GetBacktrace(cmListFileBacktrace& backtrace) const cmLocalGenerator::HOME); backtrace.push_back(lfc); } - return true; + return backtrace; } //---------------------------------------------------------------------------- @@ -1745,8 +1742,7 @@ void cmMakefile::AddIncludeDirectories(const std::vector<std::string> &incs, before ? this->IncludeDirectoriesEntries.begin() : this->IncludeDirectoriesEntries.end(); - cmListFileBacktrace lfbt; - this->GetBacktrace(lfbt); + cmListFileBacktrace lfbt = this->GetBacktrace(); cmValueWithOrigin entry(incString, lfbt); this->IncludeDirectoriesEntries.insert(position, entry); @@ -4013,8 +4009,7 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value) { return; } - cmListFileBacktrace lfbt; - this->GetBacktrace(lfbt); + cmListFileBacktrace lfbt = this->GetBacktrace(); this->IncludeDirectoriesEntries.push_back( cmValueWithOrigin(value, lfbt)); return; @@ -4026,8 +4021,7 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value) { return; } - cmListFileBacktrace lfbt; - this->GetBacktrace(lfbt); + cmListFileBacktrace lfbt = this->GetBacktrace(); this->CompileOptionsEntries.push_back(cmValueWithOrigin(value, lfbt)); return; } @@ -4038,8 +4032,7 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value) { return; } - cmListFileBacktrace lfbt; - this->GetBacktrace(lfbt); + cmListFileBacktrace lfbt = this->GetBacktrace(); cmValueWithOrigin entry(value, lfbt); this->CompileDefinitionsEntries.push_back(entry); return; @@ -4070,24 +4063,21 @@ void cmMakefile::AppendProperty(const std::string& prop, { if (prop == "INCLUDE_DIRECTORIES") { - cmListFileBacktrace lfbt; - this->GetBacktrace(lfbt); + cmListFileBacktrace lfbt = this->GetBacktrace(); this->IncludeDirectoriesEntries.push_back( cmValueWithOrigin(value, lfbt)); return; } if (prop == "COMPILE_OPTIONS") { - cmListFileBacktrace lfbt; - this->GetBacktrace(lfbt); + cmListFileBacktrace lfbt = this->GetBacktrace(); this->CompileOptionsEntries.push_back( cmValueWithOrigin(value, lfbt)); return; } if (prop == "COMPILE_DEFINITIONS") { - cmListFileBacktrace lfbt; - this->GetBacktrace(lfbt); + cmListFileBacktrace lfbt = this->GetBacktrace(); this->CompileDefinitionsEntries.push_back( cmValueWithOrigin(value, lfbt)); return; |