summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-12 22:18:26 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-16 11:56:12 (GMT)
commitc3fb0d95ad114c9f9680e885c4c2263b43c437dc (patch)
treeb17a83176a79757161a8998b397c81445db17b26 /Source/cmTarget.cxx
parentfa9dbc56a15aec71ac2eda7890efd0116797f373 (diff)
downloadCMake-c3fb0d95ad114c9f9680e885c4c2263b43c437dc.zip
CMake-c3fb0d95ad114c9f9680e885c4c2263b43c437dc.tar.gz
CMake-c3fb0d95ad114c9f9680e885c4c2263b43c437dc.tar.bz2
cmTarget: Move sanity checks and computed property access to callers
The GetProperty method is now just accessing contained data, meaning it can be implemented in cmState. Remove the cmMakefile context from the signature as a result and remove the overload with the same signature. Add a GetComputedProperty to cmTarget so that templates can be properly instantiated. Otherwise the Commands would need to be able to reach the specializations which are currently in cmTarget.cxx. As a side-effect, the CMP0026 warning now gives a backtrace to the target when issued from a generator expression.
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx23
1 files changed, 5 insertions, 18 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9b2043c..e80768d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1129,28 +1129,15 @@ void cmTarget::CheckProperty(const std::string& prop,
}
}
-const char* cmTarget::GetProperty(const std::string& prop) const
+const char* cmTarget::GetComputedProperty(
+ const std::string& prop, cmMessenger* messenger,
+ cmListFileBacktrace const& context) const
{
- return this->GetProperty(prop, this->Makefile);
+ return cmTargetPropertyComputer::GetProperty(this, prop, messenger, context);
}
-const char* cmTarget::GetProperty(const std::string& prop,
- cmMakefile* context) const
+const char* cmTarget::GetProperty(const std::string& prop) const
{
- if (!cmTargetPropertyComputer::PassesWhitelist(this->GetType(), prop,
- context->GetMessenger(),
- context->GetBacktrace())) {
- return CM_NULLPTR;
- }
-
- if (const char* result = cmTargetPropertyComputer::GetProperty(
- this, prop, context->GetMessenger(), context->GetBacktrace())) {
- return result;
- }
- if (cmSystemTools::GetFatalErrorOccured()) {
- return CM_NULLPTR;
- }
-
static UNORDERED_SET<std::string> specialProps;
#define MAKE_STATIC_PROP(PROP) static const std::string prop##PROP = #PROP
MAKE_STATIC_PROP(LINK_LIBRARIES);