diff options
author | Brad King <brad.king@kitware.com> | 2021-12-16 17:19:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-12-16 17:45:27 (GMT) |
commit | a97c92e46eff516eb4642776dcf85bd646e63763 (patch) | |
tree | 8bcbbd1e7c084ef8b8b0e4e5d1c05e9f47c80396 /Source/cmGeneratorTarget.cxx | |
parent | 0dcbf4ab588fc80a8b51d91de5c5518b13224c76 (diff) | |
download | CMake-a97c92e46eff516eb4642776dcf85bd646e63763.zip CMake-a97c92e46eff516eb4642776dcf85bd646e63763.tar.gz CMake-a97c92e46eff516eb4642776dcf85bd646e63763.tar.bz2 |
CMP0028: Report backtrace to link item rather than target creation
Now that we have proper backtraces for both `LINK_LIBRARIES` and
`INTERFACE_LINK_LIBRARIES` entries, we can report them in error
messages.
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index cdaf44c..0e17839 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -2722,8 +2722,12 @@ public: << "\" but the target was not found. Perhaps a find_package() " "call is missing for an IMPORTED target, or an ALIAS target is " "missing?"; + cmListFileBacktrace backtrace = item.Backtrace; + if (backtrace.Empty()) { + backtrace = this->Target->GetBacktrace(); + } this->Target->GetLocalGenerator()->GetCMakeInstance()->IssueMessage( - messageType, e.str(), this->Target->GetBacktrace()); + messageType, e.str(), backtrace); } } return; |