From 05251e6d80b03ae14d6a89765f14c2eb10979bd4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 13 Oct 2016 00:18:24 +0200 Subject: cmTargetPropertyComputer: Move whitelist check from cmTarget --- Source/cmTargetPropertyComputer.cxx | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'Source/cmTargetPropertyComputer.cxx') diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx index f15cb4394c..18135fa01d 100644 --- a/Source/cmTargetPropertyComputer.cxx +++ b/Source/cmTargetPropertyComputer.cxx @@ -154,7 +154,7 @@ const char* cmTargetPropertyComputer::GetLocation( } const char* cmTargetPropertyComputer::GetSources( - cmTarget const* tgt,cmMessenger* messenger, + cmTarget const* tgt, cmMessenger* messenger, cmListFileBacktrace const& context) { cmStringRange entries = tgt->GetSourceEntries(); @@ -241,3 +241,32 @@ const char* cmTargetPropertyComputer::GetSources( srcs = ss.str(); return srcs.c_str(); } + +bool cmTargetPropertyComputer::WhiteListedInterfaceProperty( + const std::string& prop) +{ + if (cmHasLiteralPrefix(prop, "INTERFACE_")) { + return true; + } + static UNORDERED_SET 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; +} -- cgit v1.2.1