diff options
author | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2023-01-04 10:56:31 +0100 |
---|---|---|
committer | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2023-01-04 10:59:26 +0100 |
commit | c65a8831c57c245208cfc14b43e9bc6c3534ab38 (patch) | |
tree | ed1f1ce87f30c646fcf4ba90bc19effaac553f58 | |
parent | ce1ddba0778ac256215731f4b823bb01dd3f5b9f (diff) | |
download | sigc++-c65a8831c57c245208cfc14b43e9bc6c3534ab38.tar.gz |
meson.build: Fix the evaluation of is_git_build on Windows
See gtkmm#131
-rw-r--r-- | meson.build | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/meson.build b/meson.build index 24b276e..189c442 100644 --- a/meson.build +++ b/meson.build @@ -47,12 +47,17 @@ python3 = find_program('python3', version: '>=3.5') # Suppose we do if and only if the meson.build file is tracked by git. cmd_py = ''' import shutil, subprocess, sys -if not shutil.which('git'): +git_exe = shutil.which('git') +if not git_exe: sys.exit(1) -cmd = [ 'git', 'ls-files', '--error-unmatch', 'meson.build' ] -sys.exit(subprocess.run(cmd, cwd="@0@", stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode) -'''.format(project_source_root) -is_git_build = run_command(python3, '-c', cmd_py, check: false).returncode() == 0 +cmd = [ git_exe, 'ls-files', '--error-unmatch', 'meson.build' ] +sys.exit(subprocess.run(cmd, cwd=sys.argv[1], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode) +''' +is_git_build = run_command( + python3, '-c', cmd_py, + project_source_root, + check: false, +).returncode() == 0 # Are we testing a dist tarball while it's being built? # There ought to be a better way. https://github.com/mesonbuild/meson/issues/6866 |