Skip to content

Commit

Permalink
do not raise error where cygpath is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
na-trium-144 committed Nov 17, 2024
1 parent 20a9be7 commit 482c609
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mesonbuild/modules/external_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,19 @@ def _configure(self, state: 'ModuleState') -> None:
configure_path = Path(self.src_dir, self.configure_command)
configure_prog = state.find_program(configure_path.as_posix())
configure_cmd = configure_prog.get_command()
# On Windows the configure command should be converted to
# unix style path by cygpath command,
# On Cygwin, MSYS2 and GitBash the configure command should be
# converted to unix style path by cygpath command,
# because the colon in the drive letter breaks many configure scripts.
# Do nothing on other environment where cygpath is not available.
if (
configure_path.drive
and len(configure_cmd) >= 2
and configure_cmd[-1] == configure_path.as_posix()
):
cygpath = state.find_program('cygpath').get_command()
_p, o, _e = Popen_safe(cygpath + [configure_cmd[-1]])
configure_cmd = configure_cmd[:-1] + [Path(o.strip("\n")).as_posix()]
cygpath = state.find_program('cygpath', required=False)
if cygpath.found():
_p, o, _e = Popen_safe(cygpath.get_command() + [configure_cmd[-1]])
configure_cmd = configure_cmd[:-1] + [Path(o.strip("\n")).as_posix()]
workdir = self.build_dir
self.make = state.find_program('make').get_command()

Expand Down

0 comments on commit 482c609

Please sign in to comment.