Skip to content

Commit d9749b0

Browse files
committed
[build tools] Added list of supported features
per @screamerbg
1 parent ce0606a commit d9749b0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tools/config.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ class Config:
147147
"application": set(["config", "custom_targets", "target_overrides", "macros", "__config_path"])
148148
}
149149

150+
# Allowed features in configurations
151+
__allowed_features = [
152+
"UVISOR", "BLE", "CLIENT", "IPV4", "IPV6"
153+
]
154+
150155
# The initialization arguments for Config are:
151156
# target: the name of the mbed target used for this configuration instance
152157
# top_level_dirs: a list of top level source directories (where mbed_abb_config.json could be found)
@@ -365,6 +370,12 @@ def get_config_data_macros(self):
365370
def get_features(self):
366371
params, _ = self.get_config_data()
367372
self._check_required_parameters(params)
368-
return ((set(Target.get_target(self.target).features)
373+
features = ((set(Target.get_target(self.target).features)
369374
| self.added_features) - self.removed_features)
375+
376+
for feature in features:
377+
if feature not in self.__allowed_features:
378+
raise ConfigException("Feature '%s' is not a supported features" % feature)
379+
380+
return features
370381

0 commit comments

Comments
 (0)