Skip to content

Commit 3afd77c

Browse files
committed
python: fix setting build_config_path
Signed-off-by: Filipe Laíns <[email protected]
1 parent 1462690 commit 3afd77c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mesonbuild/modules/python.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,13 @@ def _get_win_pythonpath(name_or_path: str) -> T.Optional[str]:
455455
return None
456456

457457
def _find_installation_impl(self, state: 'ModuleState', display_name: str, name_or_path: str, required: bool) -> MaybePythonProg:
458+
build_config = self.interpreter.environment.coredata.get_option(OptionKey('python.build_config'))
459+
458460
if not name_or_path:
459-
python = PythonExternalProgram('python3', mesonlib.python_command)
461+
python = PythonExternalProgram('python3', mesonlib.python_command, build_config_path=build_config)
460462
else:
461463
tmp_python = ExternalProgram.from_entry(display_name, name_or_path)
462-
python = PythonExternalProgram(display_name, ext_prog=tmp_python)
464+
python = PythonExternalProgram(display_name, ext_prog=tmp_python, build_config_path=build_config)
463465

464466
if not python.found() and mesonlib.is_windows():
465467
pythonpath = self._get_win_pythonpath(name_or_path)
@@ -473,7 +475,7 @@ def _find_installation_impl(self, state: 'ModuleState', display_name: str, name_
473475
# it
474476
if not python.found() and name_or_path in {'python2', 'python3'}:
475477
tmp_python = ExternalProgram.from_entry(display_name, 'python')
476-
python = PythonExternalProgram(name_or_path, ext_prog=tmp_python)
478+
python = PythonExternalProgram(name_or_path, ext_prog=tmp_python, build_config_path=build_config)
477479

478480
if python.found():
479481
if python.sanity(state):

0 commit comments

Comments
 (0)