aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2023-10-07 13:43:25 +0900
committer坂本 貴史 <o-takashi@sakamocchi.jp>2023-10-08 11:38:33 +0900
commit69864979aedf0def15a63fa7892be19a3d98bc18 (patch)
tree10fdfce7b9ec6242260d724935e4ca042ba8faaa
parent6a85d388ec84050ce352d86745c5aa4cd8606ca0 (diff)
downloadlibhinoko-69864979aedf0def15a63fa7892be19a3d98bc18.tar.gz
meson: use meson.project_build_root() to find built targets for test
The meson.project_build_root() was newly available to refer to build directory wherever the meson file locates. Reference: https://mesonbuild.com/Release-notes-for-0-56-0.html#mesonbuild_root-and-mesonsource_root-are-deprecated Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r--src/meson.build3
-rw-r--r--tests/meson.build11
2 files changed, 5 insertions, 9 deletions
diff --git a/src/meson.build b/src/meson.build
index 411a20f..948844f 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -99,9 +99,6 @@ hinoko_gir = gnome.generate_gir(myself,
install: true,
)
-# For test.
-builddir = meson.current_build_dir()
-
# For wrap dependency system.
hinoko_dep = declare_dependency(
link_with: myself,
diff --git a/tests/meson.build b/tests/meson.build
index 0f399e3..ecf4967 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -10,16 +10,15 @@ tests = [
'hinoko-functions',
]
-ld_library_paths = [builddir]
-gi_typelib_path = [builddir]
+builddirs = []
+builddirs += join_paths(meson.project_build_root(), 'src')
if hinawa_is_subproject
- ld_library_paths += hinawa_gir_dir
- gi_typelib_path += hinawa_gir_dir
+ builddirs += hinawa_gir_dir
endif
envs = environment()
-envs.append('LD_LIBRARY_PATH', ld_library_paths, separator : ':')
-envs.append('GI_TYPELIB_PATH', gi_typelib_path, separator : ':')
+envs.append('LD_LIBRARY_PATH', builddirs, separator : ':')
+envs.append('GI_TYPELIB_PATH', builddirs, separator : ':')
foreach test : tests
name = test