summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-10-12 22:18:24 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-10-15 09:14:21 (GMT)
commit637e3f3ee131cf30f7337db06314f4a1af22c245 (patch)
tree12ada449eced14d26a9edbb1f7f450a6ac31f120 /Source/cmTarget.cxx
parent05251e6d80b03ae14d6a89765f14c2eb10979bd4 (diff)
downloadCMake-637e3f3ee131cf30f7337db06314f4a1af22c245.zip
CMake-637e3f3ee131cf30f7337db06314f4a1af22c245.tar.gz
CMake-637e3f3ee131cf30f7337db06314f4a1af22c245.tar.bz2
cmTargetPropertyComputer: Unify whitelist handling from cmTarget
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx30
1 files changed, 9 insertions, 21 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3d16c50..52f1d04 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -709,13 +709,9 @@ cmBacktraceRange cmTarget::GetLinkImplementationBacktraces() const
void cmTarget::SetProperty(const std::string& prop, const char* value)
{
- if (this->GetType() == cmState::INTERFACE_LIBRARY &&
- !cmTargetPropertyComputer::WhiteListedInterfaceProperty(prop)) {
- std::ostringstream e;
- e << "INTERFACE_LIBRARY targets may only have whitelisted properties. "
- "The property \""
- << prop << "\" is not allowed.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ if (!cmTargetPropertyComputer::PassesWhitelist(
+ this->GetType(), prop, this->Makefile->GetMessenger(),
+ this->Makefile->GetBacktrace())) {
return;
}
if (prop == "NAME") {
@@ -793,13 +789,9 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
void cmTarget::AppendProperty(const std::string& prop, const char* value,
bool asString)
{
- if (this->GetType() == cmState::INTERFACE_LIBRARY &&
- !cmTargetPropertyComputer::WhiteListedInterfaceProperty(prop)) {
- std::ostringstream e;
- e << "INTERFACE_LIBRARY targets may only have whitelisted properties. "
- "The property \""
- << prop << "\" is not allowed.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ if (!cmTargetPropertyComputer::PassesWhitelist(
+ this->GetType(), prop, this->Makefile->GetMessenger(),
+ this->Makefile->GetBacktrace())) {
return;
}
if (prop == "NAME") {
@@ -1012,13 +1004,9 @@ const char* cmTarget::GetProperty(const std::string& prop) const
const char* cmTarget::GetProperty(const std::string& prop,
cmMakefile* context) const
{
- if (this->GetType() == cmState::INTERFACE_LIBRARY &&
- !cmTargetPropertyComputer::WhiteListedInterfaceProperty(prop)) {
- std::ostringstream e;
- e << "INTERFACE_LIBRARY targets may only have whitelisted properties. "
- "The property \""
- << prop << "\" is not allowed.";
- context->IssueMessage(cmake::FATAL_ERROR, e.str());
+ if (!cmTargetPropertyComputer::PassesWhitelist(this->GetType(), prop,
+ context->GetMessenger(),
+ context->GetBacktrace())) {
return CM_NULLPTR;
}