Replace 'resolution_order_names' and 'extra_labels' with 'labels'

Get rid of 'next' function
pull/10295/head
Andrii Lishchynskyi 2019-04-03 12:21:13 +03:00
parent 71e041689d
commit 1f16fec408
1 changed files with 8 additions and 9 deletions

View File

@ -45,13 +45,12 @@ class Eclipse(Makefile):
if configuration in defaults:
eclipse_config.update(defaults[configuration])
# Get target-specific options. Use resolution order and extra labels
# to find alias for target. This allows to define options within inheritance path
# Get target-specific options. Use labels to find alias
# for target. This allows to define options within inheritance path
target_specific = _CONFIGS_OPTIONS['targets']
aliases = self.toolchain.target.resolution_order_names \
+ self.toolchain.target.extra_labels
target_alias = next((t for t in aliases if t in target_specific), None)
if target_alias:
aliases = self.toolchain.target.labels
for target_alias in aliases:
if target_alias in target_specific:
eclipse_config.update(target_specific[target_alias]['generic'])
if configuration in target_specific[target_alias]:
eclipse_config.update(target_specific[target_alias][configuration])