mirror of https://github.com/ARMmbed/mbed-os.git
Rebase FEATURE_ functionality and apply device_has patch
parent
36206c1156
commit
76124f29a2
|
@ -58,7 +58,7 @@ def cached(func):
|
||||||
class Target:
|
class Target:
|
||||||
# Cumulative attributes can have values appended to them, so they
|
# Cumulative attributes can have values appended to them, so they
|
||||||
# need to be computed differently than regular attributes
|
# need to be computed differently than regular attributes
|
||||||
__cumulative_attributes = ['extra_labels', 'macros', 'features']
|
__cumulative_attributes = ['extra_labels', 'macros', 'device_has', 'features']
|
||||||
|
|
||||||
# {target_name: target_instance} map for all the targets in the system
|
# {target_name: target_instance} map for all the targets in the system
|
||||||
__target_map = {}
|
__target_map = {}
|
||||||
|
|
|
@ -307,6 +307,7 @@ class mbedToolchain:
|
||||||
# Target and Toolchain symbols
|
# Target and Toolchain symbols
|
||||||
labels = self.get_labels()
|
labels = self.get_labels()
|
||||||
self.symbols = ["TARGET_%s" % t for t in labels['TARGET']]
|
self.symbols = ["TARGET_%s" % t for t in labels['TARGET']]
|
||||||
|
self.symbols.extend(["FEATURE_%s" % t for t in labels['FEATURE']])
|
||||||
self.symbols.extend(["TOOLCHAIN_%s" % t for t in labels['TOOLCHAIN']])
|
self.symbols.extend(["TOOLCHAIN_%s" % t for t in labels['TOOLCHAIN']])
|
||||||
|
|
||||||
# Config support
|
# Config support
|
||||||
|
@ -325,10 +326,9 @@ class mbedToolchain:
|
||||||
# Add target's symbols
|
# Add target's symbols
|
||||||
self.symbols += self.target.macros
|
self.symbols += self.target.macros
|
||||||
# Add target's hardware
|
# Add target's hardware
|
||||||
try :
|
self.symbols += ["DEVICE_" + data + "=1" for data in self.target.device_has]
|
||||||
self.symbols += ["DEVICE_" + feature + "=1" for feature in self.target.features]
|
# Add target's features
|
||||||
except AttributeError :
|
self.symbols += ["FEATURE_" + data + "=1" for data in self.target.features]
|
||||||
pass
|
|
||||||
# Add extra symbols passed via 'macros' parameter
|
# Add extra symbols passed via 'macros' parameter
|
||||||
self.symbols += self.macros
|
self.symbols += self.macros
|
||||||
|
|
||||||
|
@ -348,6 +348,7 @@ class mbedToolchain:
|
||||||
toolchain_labels.remove('mbedToolchain')
|
toolchain_labels.remove('mbedToolchain')
|
||||||
self.labels = {
|
self.labels = {
|
||||||
'TARGET': self.target.get_labels() + ["DEBUG" if "debug-info" in self.options else "RELEASE"],
|
'TARGET': self.target.get_labels() + ["DEBUG" if "debug-info" in self.options else "RELEASE"],
|
||||||
|
'FEATURE': self.target.features,
|
||||||
'TOOLCHAIN': toolchain_labels
|
'TOOLCHAIN': toolchain_labels
|
||||||
}
|
}
|
||||||
return self.labels
|
return self.labels
|
||||||
|
@ -415,6 +416,7 @@ class mbedToolchain:
|
||||||
|
|
||||||
if ((d.startswith('.') or d in self.legacy_ignore_dirs) or
|
if ((d.startswith('.') or d in self.legacy_ignore_dirs) or
|
||||||
(d.startswith('TARGET_') and d[7:] not in labels['TARGET']) or
|
(d.startswith('TARGET_') and d[7:] not in labels['TARGET']) or
|
||||||
|
(d.startswith('FEATURE_') and d[8:] not in labels['FEATURE']) or
|
||||||
(d.startswith('TOOLCHAIN_') and d[10:] not in labels['TOOLCHAIN']) or
|
(d.startswith('TOOLCHAIN_') and d[10:] not in labels['TOOLCHAIN']) or
|
||||||
(d == 'TESTS')):
|
(d == 'TESTS')):
|
||||||
dirs.remove(d)
|
dirs.remove(d)
|
||||||
|
|
Loading…
Reference in New Issue