summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetPropertyComputer.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-12-07 20:23:53 (GMT)
committerBrad King <brad.king@kitware.com>2021-12-08 15:03:48 (GMT)
commitc749982c13fa00a968fe0b171946b96d0884ea54 (patch)
tree131974537adb1ee54467d2601699a723ff30d710 /Source/cmTargetPropertyComputer.cxx
parent3d378541bb22f00e3a22bf5f12e97b7943a81294 (diff)
downloadCMake-c749982c13fa00a968fe0b171946b96d0884ea54.zip
CMake-c749982c13fa00a968fe0b171946b96d0884ea54.tar.gz
CMake-c749982c13fa00a968fe0b171946b96d0884ea54.tar.bz2
cmTargetPropertyComputer: Simplify by restoring use of cmMakefile
Logically revert commit 390a7d8647 (cmTargetPropertyComputer: Implement GetProperty without cmMakefile, 2016-10-13, v3.8.0-rc1~445^2~9). It relied on using `cmListFileBacktrace` to get a scope in which to look up policies. This does remove a backtrace from `LOCATION` property errors at generate time, but the backtrace we reported before was incorrect. It pointed at the addition of a target, not to the reference to the property.
Diffstat (limited to 'Source/cmTargetPropertyComputer.cxx')
-rw-r--r--Source/cmTargetPropertyComputer.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx
index 9b94142..134b4b6 100644
--- a/Source/cmTargetPropertyComputer.cxx
+++ b/Source/cmTargetPropertyComputer.cxx
@@ -5,19 +5,17 @@
#include <sstream>
+#include "cmMakefile.h"
#include "cmMessageType.h"
-#include "cmMessenger.h"
#include "cmPolicies.h"
-#include "cmStateSnapshot.h"
bool cmTargetPropertyComputer::HandleLocationPropertyPolicy(
- std::string const& tgtName, cmMessenger* messenger,
- cmListFileBacktrace const& context)
+ std::string const& tgtName, cmMakefile const& mf)
{
std::ostringstream e;
const char* modal = nullptr;
MessageType messageType = MessageType::AUTHOR_WARNING;
- switch (context.GetBottom().GetPolicy(cmPolicies::CMP0026)) {
+ switch (mf.GetPolicyStatus(cmPolicies::CMP0026)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0026) << "\n";
modal = "should";
@@ -38,7 +36,7 @@ bool cmTargetPropertyComputer::HandleLocationPropertyPolicy(
<< "\". Use the target name directly with "
"add_custom_command, or use the generator expression $<TARGET_FILE>, "
"as appropriate.\n";
- messenger->IssueMessage(messageType, e.str(), context);
+ mf.IssueMessage(messageType, e.str());
}
return messageType != MessageType::FATAL_ERROR;