86 for v in parts.values():
87 if BUILDER_NAME_SEP in v:
88 raise ValueError('Parts cannot contain "%s"' % BUILDER_NAME_SEP)
89
90 rv_parts = []
91
93 role_key = 'role'
94 if depth != 0:
95 role_key = 'sub-role-%d' % depth
96 role = parts.get(role_key)
97 if not role:
98 raise ValueError('Invalid parts; missing key %s' % role_key)
99 s = BUILDER_NAME_SCHEMA.get(role)
100 if not s:
101 raise ValueError('Invalid parts; unknown role %s' % role)
102 rv_parts.append(role)
103 del parts[role_key]
104
105 for key in s.get('keys', []):
106 value = parts.get(key)
107 if not value:
108 raise ValueError('Invalid parts; missing %s' % key)
109 rv_parts.append(value)
110 del parts[key]
111
112 recurse_roles = s.get('recurse_roles', [])
113 if len(recurse_roles) > 0:
114 sub_role_key = 'sub-role-%d' % (depth+1)
115 sub_role = parts.get(sub_role_key)
116 if not sub_role:
117 raise ValueError('Invalid parts; missing %s' % sub_role_key)
118
119 found = False
120 for recurse_role in recurse_roles:
121 if recurse_role == sub_role:
122 found = True
123 parts =
process(depth+1, parts)
124 break
125 if not found:
126 raise ValueError('Invalid parts; unknown sub-role %s' % sub_role)
127
128 for key in s.get('optional_keys', []):
129 if parts.get(key):
130 rv_parts.append(parts[key])
131 del parts[key]
132
134 raise ValueError('Invalid parts; too many parts: %s' % parts)
135
136 return parts
137
139
140 return BUILDER_NAME_SEP.join(rv_parts)
141
142
def MakeBuilderName(**parts)
static void process(const char *inPath, const char *lexer, const char *token, const char *hPath, const char *cppPath)