Merge topic 'pp-transitive-property-handling'

77a0fd5 Genex: Use a preprocessor foreach to follow transitive properties.
1464933 Genex: Simplify the preprocessor looper for interface properties.
This commit is contained in:
Brad King 2013-11-12 08:32:13 -05:00 committed by CMake Topic Stage
commit d3f7fa22ed
3 changed files with 18 additions and 23 deletions

View File

@ -32,7 +32,7 @@ bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
ImportPropertyMap properties; ImportPropertyMap properties;
#define FIND_TARGETS(PROPERTY) \ #define FIND_TARGETS(PROPERTY) \
this->FindTargets(#PROPERTY, te, emittedDeps); this->FindTargets("INTERFACE_" #PROPERTY, te, emittedDeps);
CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS) CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS)

View File

@ -23,10 +23,10 @@
F(EvaluatingCompileOptions) F(EvaluatingCompileOptions)
#define CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(F) \ #define CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(F) \
F(INTERFACE_INCLUDE_DIRECTORIES) \ F(INCLUDE_DIRECTORIES) \
F(INTERFACE_SYSTEM_INCLUDE_DIRECTORIES) \ F(SYSTEM_INCLUDE_DIRECTORIES) \
F(INTERFACE_COMPILE_DEFINITIONS) \ F(COMPILE_DEFINITIONS) \
F(INTERFACE_COMPILE_OPTIONS) F(COMPILE_OPTIONS)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
struct cmGeneratorExpressionDAGChecker struct cmGeneratorExpressionDAGChecker

View File

@ -652,7 +652,7 @@ static const struct JoinNode : public cmGeneratorExpressionNode
} joinNode; } joinNode;
#define TRANSITIVE_PROPERTY_NAME(PROPERTY) \ #define TRANSITIVE_PROPERTY_NAME(PROPERTY) \
, #PROPERTY , "INTERFACE_" #PROPERTY
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static const char* targetPropertyTransitiveWhitelist[] = { static const char* targetPropertyTransitiveWhitelist[] = {
@ -893,26 +893,21 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
std::string interfacePropertyName; std::string interfacePropertyName;
if (propertyName == "INTERFACE_INCLUDE_DIRECTORIES" #define POPULATE_INTERFACE_PROPERTY_NAME(prop) \
|| propertyName == "INCLUDE_DIRECTORIES") if (propertyName == #prop || propertyName == "INTERFACE_" #prop) \
{ { \
interfacePropertyName = "INTERFACE_INCLUDE_DIRECTORIES"; interfacePropertyName = "INTERFACE_" #prop; \
} } \
else if (propertyName == "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES") else
{
interfacePropertyName = "INTERFACE_SYSTEM_INCLUDE_DIRECTORIES"; CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(POPULATE_INTERFACE_PROPERTY_NAME)
} // Note that the above macro terminates with an else
else if (propertyName == "INTERFACE_COMPILE_DEFINITIONS" /* else */ if (strncmp(propertyName.c_str(),
|| propertyName == "COMPILE_DEFINITIONS" "COMPILE_DEFINITIONS_", 20) == 0)
|| strncmp(propertyName.c_str(), "COMPILE_DEFINITIONS_", 20) == 0)
{ {
interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS"; interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS";
} }
else if (propertyName == "INTERFACE_COMPILE_OPTIONS" #undef POPULATE_INTERFACE_PROPERTY_NAME
|| propertyName == "COMPILE_OPTIONS")
{
interfacePropertyName = "INTERFACE_COMPILE_OPTIONS";
}
cmTarget const* headTarget = context->HeadTarget cmTarget const* headTarget = context->HeadTarget
? context->HeadTarget : target; ? context->HeadTarget : target;