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 <jeffy.chen@rock-chips.com>
This commit is contained in:
Jeffy Chen
2025-02-26 08:34:55 +08:00
committed by Ivan Podogov
parent 2348f071cf
commit d0699351c2
2 changed files with 12 additions and 14 deletions

View File

@@ -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']

View File

@@ -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