Skip to content

Commit e7c3c88

Browse files
committed
Introduce FEATURE_ keyword which behaves like TARGET_ but is generated from targets features (see targets.json)
1 parent 7d583e5 commit e7c3c88

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

workspace_tools/toolchains/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ def get_symbols(self):
281281
# Target and Toolchain symbols
282282
labels = self.get_labels()
283283
self.symbols = ["TARGET_%s" % t for t in labels['TARGET']]
284+
self.symbols.extend(["FEATURE_%s" % t for t in labels['FEATURE']])
284285
self.symbols.extend(["TOOLCHAIN_%s" % t for t in labels['TOOLCHAIN']])
285286

286287
# Config support
@@ -314,6 +315,7 @@ def get_labels(self):
314315
toolchain_labels.remove('mbedToolchain')
315316
self.labels = {
316317
'TARGET': self.target.get_labels(),
318+
'FEATURE': self.target.features,
317319
'TOOLCHAIN': toolchain_labels
318320
}
319321
return self.labels
@@ -364,6 +366,7 @@ def scan_resources(self, path):
364366

365367
if ((d.startswith('.') or d in self.legacy_ignore_dirs) or
366368
(d.startswith('TARGET_') and d[7:] not in labels['TARGET']) or
369+
(d.startswith('FEATURE_') and d[8:] not in labels['FEATURE']) or
367370
(d.startswith('TOOLCHAIN_') and d[10:] not in labels['TOOLCHAIN'])):
368371
dirs.remove(d)
369372

0 commit comments

Comments
 (0)