meson: fix subproject build regression
commit ae9ac2a1 from !165 introduced a regression when
fontconfig is built as a subproject. In that case we
would fail to correctly construct the path to the root
build dir where the meson-info subdirectory resides,
instead looking for it in the fontconfig subproject
subdir. This would result in
FAILED: subprojects/fontconfig/src/fcobjshash.gperf
errors in the cutout.py script.
Instead use the @BUILD_ROOT@ substitution to get
to the build root which will work correctly in
either scenario.
diff --git a/src/meson.build b/src/meson.build
index 7f9bf31..73cb2de 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -44,13 +44,10 @@
cpp += ['-I', join_paths(meson.current_source_dir(), '..')]
-# Can use meson.project_build_dir() once we require Meson 0.56
-project_build_dir = meson.current_build_dir() / '..'
-
fcobjshash_gperf = custom_target('fcobjshash.gperf',
input: 'fcobjshash.gperf.h',
output: 'fcobjshash.gperf',
- command: [python3, files('cutout.py')[0], '@INPUT@', '@OUTPUT@', project_build_dir, cpp],
+ command: [python3, files('cutout.py')[0], '@INPUT@', '@OUTPUT@', '@BUILD_ROOT@', cpp],
build_by_default: true,
)