From cebefa71fad223f134529a2b859006360e465a80 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 8 Feb 2014 12:11:32 -0500 Subject: [PATCH] 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. --- Source/cmTarget.cxx | 100 ++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 62b30fd05..09eb8a4d9 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3100,51 +3100,7 @@ const char *cmTarget::GetProperty(const std::string& prop, } if(specialProps.count(prop)) { - if(prop == "INCLUDE_DIRECTORIES") - { - if (this->Internal->IncludeDirectoriesEntries.empty()) - { - return 0; - } - - static std::string output; - MakePropertyList(output, this->Internal->IncludeDirectoriesEntries); - return output.c_str(); - } - else if(prop == "COMPILE_OPTIONS") - { - if (this->Internal->CompileOptionsEntries.empty()) - { - return 0; - } - - static std::string output; - MakePropertyList(output, this->Internal->CompileOptionsEntries); - return output.c_str(); - } - else if(prop == "COMPILE_FEATURES") - { - if (this->Internal->CompileFeaturesEntries.empty()) - { - return 0; - } - - static std::string output; - MakePropertyList(output, this->Internal->CompileFeaturesEntries); - return output.c_str(); - } - else if(prop == "COMPILE_DEFINITIONS") - { - if (this->Internal->CompileDefinitionsEntries.empty()) - { - return 0; - } - - static std::string output; - MakePropertyList(output, this->Internal->CompileDefinitionsEntries); - return output.c_str(); - } - else if(prop == "LINK_LIBRARIES") + if(prop == "LINK_LIBRARIES") { if (this->Internal->LinkImplementationPropertyEntries.empty()) { @@ -3165,6 +3121,55 @@ const char *cmTarget::GetProperty(const std::string& prop, } return output.c_str(); } + // the type property returns what type the target is + else if (prop == "TYPE") + { + 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->IncludeDirectoriesEntries); + return output.c_str(); + } + else if(prop == "COMPILE_FEATURES") + { + if (this->Internal->CompileFeaturesEntries.empty()) + { + return 0; + } + + static std::string output; + MakePropertyList(output, this->Internal->CompileFeaturesEntries); + return output.c_str(); + } + else if(prop == "COMPILE_OPTIONS") + { + if (this->Internal->CompileOptionsEntries.empty()) + { + return 0; + } + + static std::string output; + MakePropertyList(output, this->Internal->CompileOptionsEntries); + return output.c_str(); + } + else if(prop == "COMPILE_DEFINITIONS") + { + if (this->Internal->CompileDefinitionsEntries.empty()) + { + return 0; + } + + static std::string output; + MakePropertyList(output, this->Internal->CompileDefinitionsEntries); + return output.c_str(); + } else if (prop == "IMPORTED") { return this->IsImported()?"TRUE":"FALSE"; @@ -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;