Skip to content

Commit 24e767c

Browse files
committed
Merge pull request #1888 from sg-/feature-label
Feature label
2 parents 91b9613 + d71f015 commit 24e767c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

hal/targets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"is_disk_virtual": false,
88
"macros": [],
99
"device_has": [],
10+
"features": [],
1011
"detect_code": [],
1112
"public": false
1213
},

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)