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)
commit05251e6d80b03ae14d6a89765f14c2eb10979bd4 (patch)
tree02813e4d853ef97582de7d4c6c0dd6f97e61cbb1 /Source/cmTarget.cxx
parentfbf1721c94b40ea86eeb183a1916f2066eb64bdc (diff)
downloadCMake-05251e6d80b03ae14d6a89765f14c2eb10979bd4.zip
CMake-05251e6d80b03ae14d6a89765f14c2eb10979bd4.tar.gz
CMake-05251e6d80b03ae14d6a89765f14c2eb10979bd4.tar.bz2
cmTargetPropertyComputer: Move whitelist check from cmTarget
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx34
1 files changed, 3 insertions, 31 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 63a6fe9..3d16c50 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -707,38 +707,10 @@ cmBacktraceRange cmTarget::GetLinkImplementationBacktraces() const
return cmMakeRange(this->Internal->LinkImplementationPropertyBacktraces);
}
-static bool whiteListedInterfaceProperty(const std::string& prop)
-{
- if (cmHasLiteralPrefix(prop, "INTERFACE_")) {
- return true;
- }
- static UNORDERED_SET<std::string> builtIns;
- if (builtIns.empty()) {
- builtIns.insert("COMPATIBLE_INTERFACE_BOOL");
- builtIns.insert("COMPATIBLE_INTERFACE_NUMBER_MAX");
- builtIns.insert("COMPATIBLE_INTERFACE_NUMBER_MIN");
- builtIns.insert("COMPATIBLE_INTERFACE_STRING");
- builtIns.insert("EXPORT_NAME");
- builtIns.insert("IMPORTED");
- builtIns.insert("NAME");
- builtIns.insert("TYPE");
- }
-
- if (builtIns.count(prop)) {
- return true;
- }
-
- if (cmHasLiteralPrefix(prop, "MAP_IMPORTED_CONFIG_")) {
- return true;
- }
-
- return false;
-}
-
void cmTarget::SetProperty(const std::string& prop, const char* value)
{
if (this->GetType() == cmState::INTERFACE_LIBRARY &&
- !whiteListedInterfaceProperty(prop)) {
+ !cmTargetPropertyComputer::WhiteListedInterfaceProperty(prop)) {
std::ostringstream e;
e << "INTERFACE_LIBRARY targets may only have whitelisted properties. "
"The property \""
@@ -822,7 +794,7 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
bool asString)
{
if (this->GetType() == cmState::INTERFACE_LIBRARY &&
- !whiteListedInterfaceProperty(prop)) {
+ !cmTargetPropertyComputer::WhiteListedInterfaceProperty(prop)) {
std::ostringstream e;
e << "INTERFACE_LIBRARY targets may only have whitelisted properties. "
"The property \""
@@ -1041,7 +1013,7 @@ const char* cmTarget::GetProperty(const std::string& prop,
cmMakefile* context) const
{
if (this->GetType() == cmState::INTERFACE_LIBRARY &&
- !whiteListedInterfaceProperty(prop)) {
+ !cmTargetPropertyComputer::WhiteListedInterfaceProperty(prop)) {
std::ostringstream e;
e << "INTERFACE_LIBRARY targets may only have whitelisted properties. "
"The property \""