Skip to content

Commit d2ba21a

Browse files
author
Marian Rassat
committed
fix: properly handle paths for build to work
1 parent 5ed0b89 commit d2ba21a

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ project(
33
'cpp',
44
version: run_command(
55
'python',
6-
'version.py',
6+
meson.source_root() / 'version.py',
77
'get-vcs',
88
).stdout().strip(),
99
default_options: [
1010
'cpp_std=c++17',
1111
],
1212
)
1313

14-
meson.add_dist_script('python', 'version.py', 'set-dist', meson.project_version())
14+
meson.add_dist_script('python', meson.source_root() / 'version.py', 'set-dist', meson.project_version())
1515

1616
py = import('python').find_installation(pure: false)
1717

version.py

+4-13
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,10 @@ def set_dist(version):
1818
sys.exit(1)
1919

2020
print(meson_project_dist_root)
21-
subprocess.run(
22-
[
23-
meson_rewrite,
24-
"--sourcedir=" + meson_project_dist_root,
25-
"kwargs",
26-
"set",
27-
"project",
28-
"/",
29-
"version",
30-
version,
31-
],
32-
check=True,
33-
)
21+
rewrite_command = f"{meson_rewrite} --sourcedir {meson_project_dist_root} "
22+
rewrite_command += f"kwargs set project / version {version}"
23+
24+
subprocess.run(rewrite_command.split(" "))
3425

3526

3627
if __name__ == "__main__":

0 commit comments

Comments
 (0)