From d0699351c29f8af864ee7a749840cc40b1c47489 Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Wed, 26 Feb 2025 08:34:55 +0800 Subject: [PATCH] meson: Fix rpath error Fix the issue where rpath introduces absolute paths when building outside the source directory. Change-Id: I4d5fd66211e0fea5ce0dc8fd0d1bb2e32bd0fc6f Signed-off-by: Jeffy Chen --- hook/meson.build | 3 +-- meson.build | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/hook/meson.build b/hook/meson.build index 9243ff0..e8f859e 100644 --- a/hook/meson.build +++ b/hook/meson.build @@ -22,7 +22,6 @@ libhook_cflags = [ ] libhook_dep = [ - mali, dependency('threads'), cc.find_library('dl', required : false), dependency('libdrm', version : '>= 2.4.0'), @@ -65,8 +64,8 @@ libhook = shared_library( c_args : libhook_cflags, include_directories : libhook_inc, dependencies : libhook_dep, + link_with : libmali, install : true, - install_rpath : '$ORIGIN', version : mali_version) libhook_ldflags = ['-L${libdir}', '-lmali-hook'] diff --git a/meson.build b/meson.build index 3687791..71f5943 100644 --- a/meson.build +++ b/meson.build @@ -189,17 +189,6 @@ map = { 'vulkan' : ['vk_icdGetInstanceProcAddr', vk_wrappers, {}, mali_version], } -libhook = [] -if build_hook - # Build hook library - subdir('hook') - - # Recommend to link hook library before libmali - mali_ldflags = libhook_ldflags -else - mali_ldflags = [] -endif - # Create dummy source for building dummy libraries dummy_source = join_paths(meson.current_build_dir(), 'dummy.c') run_command('touch', dummy_source, check : false) @@ -211,6 +200,17 @@ libmali = shared_library( install : true, version : mali_version) +libhook = [] +if build_hook + # Build hook library + subdir('hook') + + # Recommend to link hook library before libmali + mali_ldflags = libhook_ldflags +else + mali_ldflags = [] +endif + mali_ldflags += ['-L${libdir}', '-lmali'] pkgconfig.generate( @@ -256,7 +256,6 @@ foreach name, values : map link_with : [libhook, libmali], install : true, install_dir : wrapper_libdir, - install_rpath : '$ORIGIN', version : version) endforeach