diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-10-19 20:39:08 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-20 22:37:03 (GMT) |
commit | 215cd21a0238ba00aec7c81014fe83e3d47187a6 (patch) | |
tree | bf800cbdd8d30cc30df1df2dded5a94a52112fe4 | |
parent | 1df8bd3ab0f6621b90a8801c1d10cfc94c74ff96 (diff) | |
download | CMake-215cd21a0238ba00aec7c81014fe83e3d47187a6.zip CMake-215cd21a0238ba00aec7c81014fe83e3d47187a6.tar.gz CMake-215cd21a0238ba00aec7c81014fe83e3d47187a6.tar.bz2 |
cmGeneratorTarget: Provide direct access to the backtrace.
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 10 | ||||
-rw-r--r-- | Source/cmComputeTargetDepends.cxx | 2 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 29 | ||||
-rw-r--r-- | Source/cmGeneratorTarget.h | 2 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmOrderDirectories.cxx | 4 |
6 files changed, 29 insertions, 22 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 6ca15a3..eca0f66 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -571,7 +571,7 @@ bool cmComputeLinkInformation::Compute() "name." ; this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); } return true; @@ -1548,7 +1548,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item, << " " << item << "\n" << "which is a full-path but not a valid library file name."; this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); } } case cmPolicies::OLD: @@ -1566,7 +1566,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item, << " " << item << "\n" << "which is a full-path but not a valid library file name."; this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); } break; } @@ -1594,7 +1594,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories() std::ostringstream w; this->PrintLinkPolicyDiagnosis(w); this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); } case cmPolicies::OLD: // OLD behavior is to add the paths containing libraries with @@ -1610,7 +1610,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories() e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0003) << "\n"; this->PrintLinkPolicyDiagnosis(e); this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); return false; } } diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 3541922..2ae8084 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -245,7 +245,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) ->IssueMessage(cmake::FATAL_ERROR, "Only executables and non-OBJECT libraries may " "reference target objects.", - depender->Target->GetBacktrace()); + depender->GetBacktrace()); return; } const_cast<cmGeneratorTarget*>(depender)->Target->AddUtility(objLib); diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index c68b84a..0a1a364 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -62,7 +62,7 @@ void reportBadObjLib(std::vector<cmSourceFile*> const& badObjLib, e << "but may contain only sources that compile, header files, and " "other files that would not affect linking of a normal library."; cm->IssueMessage(cmake::FATAL_ERROR, e.str(), - target->Target->GetBacktrace()); + target->GetBacktrace()); } } @@ -483,7 +483,7 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config, ->IssueMessage( cmake::FATAL_ERROR, "Target '" + this->GetName() + "' OUTPUT_NAME depends on itself.", - this->Target->GetBacktrace()); + this->GetBacktrace()); } return i->second; } @@ -1007,7 +1007,7 @@ static bool processSources(cmGeneratorTarget const* tgt, { cmake* cm = tgt->GetLocalGenerator()->GetCMakeInstance(); cm->IssueMessage(cmake::FATAL_ERROR, e, - tgt->Target->GetBacktrace()); + tgt->GetBacktrace()); } return contextDependent; } @@ -1471,7 +1471,7 @@ bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir( w << " corrupt."; cmake* cm = this->LocalGenerator->GetCMakeInstance(); cm->IssueMessage(cmake::FATAL_ERROR, w.str(), - this->Target->GetBacktrace()); + this->GetBacktrace()); } return true; @@ -1703,6 +1703,11 @@ std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const } } +cmListFileBacktrace cmGeneratorTarget::GetBacktrace() const +{ + return this->Target->GetBacktrace(); +} + //---------------------------------------------------------------------------- class cmTargetCollectLinkLanguages { @@ -1749,7 +1754,7 @@ public: "call is missing for an IMPORTED target, or an ALIAS target is " "missing?"; this->Target->GetLocalGenerator()->GetCMakeInstance()->IssueMessage( - messageType, e.str(), this->Target->Target->GetBacktrace()); + messageType, e.str(), this->Target->GetBacktrace()); } } return; @@ -1846,7 +1851,7 @@ public: e << "Set the LINKER_LANGUAGE property for this target."; cmake* cm = this->Target->GetLocalGenerator()->GetCMakeInstance(); cm->IssueMessage(cmake::FATAL_ERROR, e.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); } return *this->Preferred.begin(); } @@ -4831,7 +4836,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo( this->LocalGenerator->GetCMakeInstance()->IssueMessage( cmake::FATAL_ERROR, "Target '" + this->GetName() + "' OUTPUT_DIRECTORY depends on itself.", - this->Target->GetBacktrace()); + this->GetBacktrace()); return 0; } return &i->second; @@ -5578,7 +5583,7 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const << "Target \"" << this->GetName() << "\" links to item \"" << item << "\" which has leading or trailing whitespace."; cm->IssueMessage(cmake::AUTHOR_WARNING, w.str(), - this->Target->GetBacktrace()); + this->GetBacktrace()); } case cmPolicies::OLD: break; @@ -5589,7 +5594,7 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const << item << "\" which has leading or trailing whitespace. " << "This is now an error according to policy CMP0004."; cm->IssueMessage(cmake::FATAL_ERROR, e.str(), - this->Target->GetBacktrace()); + this->GetBacktrace()); } break; case cmPolicies::REQUIRED_IF_USED: @@ -5600,7 +5605,7 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const << "Target \"" << this->GetName() << "\" links to item \"" << item << "\" which has leading or trailing whitespace."; cm->IssueMessage(cmake::FATAL_ERROR, e.str(), - this->Target->GetBacktrace()); + this->GetBacktrace()); } break; } @@ -5798,7 +5803,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries( { e << "Target \"" << this->GetName() << "\" links to itself."; this->LocalGenerator->GetCMakeInstance()->IssueMessage( - messageType, e.str(), this->Target->GetBacktrace()); + messageType, e.str(), this->GetBacktrace()); if (messageType == cmake::FATAL_ERROR) { return; @@ -5873,7 +5878,7 @@ cmGeneratorTarget::FindTargetToLink(std::string const& name) const "with the ENABLE_EXPORTS property set."; cmake* cm = this->LocalGenerator->GetCMakeInstance(); cm->IssueMessage(cmake::FATAL_ERROR, e.str(), - this->Target->GetBacktrace()); + this->GetBacktrace()); tgt = 0; } diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h index a6b7f6e..9533f43 100644 --- a/Source/cmGeneratorTarget.h +++ b/Source/cmGeneratorTarget.h @@ -166,6 +166,8 @@ public: * install tree. For example: "\@rpath/" or "\@loader_path/". */ std::string GetInstallNameDirForInstallTree() const; + cmListFileBacktrace GetBacktrace() const; + /** Get the soname of the target. Allowed only for a shared library. */ std::string GetSOName(const std::string& config) const; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index deda88e..c65d9e0 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1982,7 +1982,7 @@ AddCompilerRequirementFlag(std::string &flags, std::string e = lang + "_STANDARD is set to invalid value '" + standard + "'"; this->GetGlobalGenerator()->GetCMakeInstance() - ->IssueMessage(cmake::FATAL_ERROR, e, target->Target->GetBacktrace()); + ->IssueMessage(cmake::FATAL_ERROR, e, target->GetBacktrace()); return; } @@ -2141,7 +2141,7 @@ void cmLocalGenerator "For compatibility CMake is not honoring them for this target."; target->Target->GetMakefile()->GetCMakeInstance() ->IssueMessage(cmake::AUTHOR_WARNING, w.str(), - target->Target->GetBacktrace()); + target->GetBacktrace()); } } diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx index 35ee127..e3eedc7 100644 --- a/Source/cmOrderDirectories.cxx +++ b/Source/cmOrderDirectories.cxx @@ -555,7 +555,7 @@ void cmOrderDirectories::FindImplicitConflicts() << "Some of these libraries may not be found correctly."; this->GlobalGenerator->GetCMakeInstance() ->IssueMessage(cmake::WARNING, w.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); } //---------------------------------------------------------------------------- @@ -637,5 +637,5 @@ void cmOrderDirectories::DiagnoseCycle() e << "Some of these libraries may not be found correctly."; this->GlobalGenerator->GetCMakeInstance() ->IssueMessage(cmake::WARNING, e.str(), - this->Target->Target->GetBacktrace()); + this->Target->GetBacktrace()); } |