Commit cebefa71 authored by Ben Boeckel's avatar Ben Boeckel Committed by Ben Boeckel
Browse files

cmTarget: Sort special property checks

The LINK_LIBRARIES property is by *far* the most popular. Move it to the
top. TYPE is second, but with more generator expression usage, that may
change in the future.
parent 97ce676e
......@@ -3100,26 +3100,41 @@ const char *cmTarget::GetProperty(const std::string& prop,
}
if(specialProps.count(prop))
{
if(prop == "INCLUDE_DIRECTORIES")
if(prop == "LINK_LIBRARIES")
{
if (this->Internal->IncludeDirectoriesEntries.empty())
if (this->Internal->LinkImplementationPropertyEntries.empty())
{
return 0;
}
static std::string output;
MakePropertyList(output, this->Internal->IncludeDirectoriesEntries);
output = "";
std::string sep;
for (std::vector<cmValueWithOrigin>::const_iterator
it = this->Internal->LinkImplementationPropertyEntries.begin(),
end = this->Internal->LinkImplementationPropertyEntries.end();
it != end; ++it)
{
output += sep;
output += it->Value;
sep = ";";
}
return output.c_str();
}
else if(prop == "COMPILE_OPTIONS")
// the type property returns what type the target is
else if (prop == "TYPE")
{
if (this->Internal->CompileOptionsEntries.empty())
return cmTarget::GetTargetTypeName(this->GetType());
}
else if(prop == "INCLUDE_DIRECTORIES")
{
if (this->Internal->IncludeDirectoriesEntries.empty())
{
return 0;
}
static std::string output;
MakePropertyList(output, this->Internal->CompileOptionsEntries);
MakePropertyList(output, this->Internal->IncludeDirectoriesEntries);
return output.c_str();
}
else if(prop == "COMPILE_FEATURES")
......@@ -3133,36 +3148,26 @@ const char *cmTarget::GetProperty(const std::string& prop,
MakePropertyList(output, this->Internal->CompileFeaturesEntries);
return output.c_str();
}
else if(prop == "COMPILE_DEFINITIONS")
else if(prop == "COMPILE_OPTIONS")
{
if (this->Internal->CompileDefinitionsEntries.empty())
if (this->Internal->CompileOptionsEntries.empty())
{
return 0;
}
static std::string output;
MakePropertyList(output, this->Internal->CompileDefinitionsEntries);
MakePropertyList(output, this->Internal->CompileOptionsEntries);
return output.c_str();
}
else if(prop == "LINK_LIBRARIES")
else if(prop == "COMPILE_DEFINITIONS")
{
if (this->Internal->LinkImplementationPropertyEntries.empty())
if (this->Internal->CompileDefinitionsEntries.empty())
{
return 0;
}
static std::string output;
output = "";
std::string sep;
for (std::vector<cmValueWithOrigin>::const_iterator
it = this->Internal->LinkImplementationPropertyEntries.begin(),
end = this->Internal->LinkImplementationPropertyEntries.end();
it != end; ++it)
{
output += sep;
output += it->Value;
sep = ";";
}
MakePropertyList(output, this->Internal->CompileDefinitionsEntries);
return output.c_str();
}
else if (prop == "IMPORTED")
......@@ -3270,11 +3275,6 @@ const char *cmTarget::GetProperty(const std::string& prop,
this->Properties.SetProperty("SOURCES", ss.str().c_str(),
cmProperty::TARGET);
}
// the type property returns what type the target is
else if (prop == "TYPE")
{
return cmTarget::GetTargetTypeName(this->GetType());
}
}
bool chain = false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment