Skip to content

Commit 1f16fec

Browse files
author
Andrii Lishchynskyi
committed
Replace 'resolution_order_names' and 'extra_labels' with 'labels'
Get rid of 'next' function
1 parent 71e0416 commit 1f16fec

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

tools/export/cdt/__init__.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,15 @@ def get_target_config(self, configuration):
4545
if configuration in defaults:
4646
eclipse_config.update(defaults[configuration])
4747

48-
# Get target-specific options. Use resolution order and extra labels
49-
# to find alias for target. This allows to define options within inheritance path
48+
# Get target-specific options. Use labels to find alias
49+
# for target. This allows to define options within inheritance path
5050
target_specific = _CONFIGS_OPTIONS['targets']
51-
aliases = self.toolchain.target.resolution_order_names \
52-
+ self.toolchain.target.extra_labels
53-
target_alias = next((t for t in aliases if t in target_specific), None)
54-
if target_alias:
55-
eclipse_config.update(target_specific[target_alias]['generic'])
56-
if configuration in target_specific[target_alias]:
57-
eclipse_config.update(target_specific[target_alias][configuration])
51+
aliases = self.toolchain.target.labels
52+
for target_alias in aliases:
53+
if target_alias in target_specific:
54+
eclipse_config.update(target_specific[target_alias]['generic'])
55+
if configuration in target_specific[target_alias]:
56+
eclipse_config.update(target_specific[target_alias][configuration])
5857

5958
return eclipse_config
6059

0 commit comments

Comments
 (0)