Skip to content

Commit 66cf573

Browse files
committed
Always use build-details if specified
Signed-off-by: Michał Górny <mgorny@gentoo.org>
1 parent 7a33fb4 commit 66cf573

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

mesonpy/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -786,15 +786,15 @@ def __init__(
786786
# Handle cross compilation
787787
self._is_cross = any(s.startswith('--cross-file') for s in self._meson_args['setup'])
788788
self._build_details = None
789-
if self._is_cross:
790-
# Use build-details.json (PEP 739) to determine
791-
# platform/interpreter/abi tags, if given.
792-
for setup_arg in self._meson_args['setup']:
793-
if setup_arg.startswith('-Dpython.build_config='):
794-
with open(setup_arg.split('-Dpython.build_config=')[1]) as f:
795-
self._build_details = json.load(f)
796-
break
797-
else:
789+
# Use build-details.json (PEP 739) to determine
790+
# platform/interpreter/abi tags, if given.
791+
for setup_arg in reversed(self._meson_args['setup']):
792+
if setup_arg.startswith('-Dpython.build_config='):
793+
with open(setup_arg.split('=', 1)[1]) as f:
794+
self._build_details = json.load(f)
795+
break
796+
else:
797+
if self._is_cross:
798798
# TODO: warn that interpreter details may be wrong. Get platform from cross file.
799799
pass
800800

0 commit comments

Comments
 (0)