cmTarget: Fast path for regular properties

This commit is contained in:
Ben Boeckel 2014-02-08 05:27:45 -05:00 committed by Ben Boeckel
parent 4cfa918a9a
commit 97ce676e75
1 changed files with 171 additions and 155 deletions

View File

@ -3085,6 +3085,21 @@ const char *cmTarget::GetProperty(const std::string& prop,
} }
} }
} }
static std::set<std::string> specialProps;
if(specialProps.empty())
{
specialProps.insert("INCLUDE_DIRECTORIES");
specialProps.insert("COMPILE_FEATURES");
specialProps.insert("COMPILE_OPTIONS");
specialProps.insert("COMPILE_DEFINITIONS");
specialProps.insert("LINK_LIBRARIES");
specialProps.insert("IMPORTED");
specialProps.insert("NAME");
specialProps.insert("SOURCES");
specialProps.insert("TYPE");
}
if(specialProps.count(prop))
{
if(prop == "INCLUDE_DIRECTORIES") if(prop == "INCLUDE_DIRECTORIES")
{ {
if (this->Internal->IncludeDirectoriesEntries.empty()) if (this->Internal->IncludeDirectoriesEntries.empty())
@ -3212,12 +3227,12 @@ const char *cmTarget::GetProperty(const std::string& prop,
} }
if (!noMessage) if (!noMessage)
{ {
e << "Target \"" << this->Name << "\" contains $<TARGET_OBJECTS> " e << "Target \"" << this->Name << "\" contains "
"generator expression in its sources list. This content was not " "$<TARGET_OBJECTS> generator expression in its sources list. "
"previously part of the SOURCES property when that property was " "This content was not previously part of the SOURCES property "
"read at configure time. Code reading that property needs to be " "when that property was read at configure time. Code reading "
"adapted to ignore the generator expression using the " "that property needs to be adapted to ignore the generator "
"string(GENEX_STRIP) command."; "expression using the string(GENEX_STRIP) command.";
context->IssueMessage(messageType, e.str()); context->IssueMessage(messageType, e.str());
} }
if (addContent) if (addContent)
@ -3260,6 +3275,7 @@ const char *cmTarget::GetProperty(const std::string& prop,
{ {
return cmTarget::GetTargetTypeName(this->GetType()); return cmTarget::GetTargetTypeName(this->GetType());
} }
}
bool chain = false; bool chain = false;
const char *retVal = const char *retVal =