diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index e19d5e5c4..9376e98ae 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -1793,7 +1793,7 @@ public: UNORDERED_SET& languages, cmGeneratorTarget const* head): Config(config), Languages(languages), HeadTarget(head), - Makefile(target->Target->GetMakefile()), Target(target) + Target(target) { this->Visited.insert(target); } void Visit(cmLinkItem const& item) @@ -1805,7 +1805,8 @@ public: bool noMessage = false; cmake::MessageType messageType = cmake::FATAL_ERROR; std::stringstream e; - switch(this->Makefile->GetPolicyStatus(cmPolicies::CMP0028)) + switch(this->Target->GetLocalGenerator() + ->GetPolicyStatus(cmPolicies::CMP0028)) { case cmPolicies::WARN: { @@ -1859,7 +1860,6 @@ private: std::string Config; UNORDERED_SET& Languages; cmGeneratorTarget const* HeadTarget; - cmMakefile* Makefile; const cmGeneratorTarget* Target; std::set Visited; };