Commit cef59bb8 authored by Stephen Kelly's avatar Stephen Kelly
Browse files

cmTarget: Implement GetProperty in terms of cmState::Snapshot

parent 0d57b07a
Pipeline #31186 passed with stage
...@@ -1222,10 +1222,16 @@ const char* cmTarget::GetProperty(const std::string& prop) const ...@@ -1222,10 +1222,16 @@ const char* cmTarget::GetProperty(const std::string& prop) const
return this->GetName().c_str(); return this->GetName().c_str();
} }
if (prop == propBINARY_DIR) { if (prop == propBINARY_DIR) {
return this->GetMakefile()->GetCurrentBinaryDirectory(); return this->GetMakefile()
->GetStateSnapshot()
.GetDirectory()
.GetCurrentBinary();
} }
if (prop == propSOURCE_DIR) { if (prop == propSOURCE_DIR) {
return this->GetMakefile()->GetCurrentSourceDirectory(); return this->GetMakefile()
->GetStateSnapshot()
.GetDirectory()
.GetCurrentSource();
} }
} }
...@@ -1234,7 +1240,8 @@ const char* cmTarget::GetProperty(const std::string& prop) const ...@@ -1234,7 +1240,8 @@ const char* cmTarget::GetProperty(const std::string& prop) const
const bool chain = this->GetMakefile()->GetState()->IsPropertyChained( const bool chain = this->GetMakefile()->GetState()->IsPropertyChained(
prop, cmProperty::TARGET); prop, cmProperty::TARGET);
if (chain) { if (chain) {
return this->Makefile->GetProperty(prop, chain); return this->Makefile->GetStateSnapshot().GetDirectory().GetProperty(
prop, chain);
} }
} }
return retVal; return retVal;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment