summaryrefslogtreecommitdiff
path: root/tests/amdgpu
diff options
context:
space:
mode:
authorArkadiusz Hiler <arkadiusz.hiler@intel.com>2018-07-09 17:27:11 +0300
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2018-07-27 15:51:53 +0300
commit299880dcc048acf3261639cc31e2f8d5e5054df1 (patch)
treed905feae341c09a2c350a8617f9cc5cd4efcacd0 /tests/amdgpu
parent9432b5e36bb467d330e6ee058971ce844051fa19 (diff)
amdgpu/meson: Set the correct rpath
AMDGPU tests were reusing rpath set in tests/meson.build, which does not account for the extra level of nesting, so let's define a new one. Cc: Harry Wentland <harry.wentland@amd.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tests/amdgpu')
-rw-r--r--tests/amdgpu/meson.build28
1 files changed, 26 insertions, 2 deletions
diff --git a/tests/amdgpu/meson.build b/tests/amdgpu/meson.build
index af5e74c7..15cfb2b5 100644
--- a/tests/amdgpu/meson.build
+++ b/tests/amdgpu/meson.build
@@ -9,11 +9,35 @@ if libdrm_amdgpu.found()
amdgpu_deps += libdrm_amdgpu
endif
+amdgpudir = join_paths(libexecdir, 'amdgpu')
+
+if get_option('use_rpath')
+ # Set up runpath for the test executables towards libigt.so.
+ # The path should be relative to $ORIGIN so the library is
+ # still found properly even if installed to a path other than
+ # prefix.
+
+ # libdir and libexecdir are pathnames relative to
+ # prefix. meson enforces this.
+
+ # Start from the executable
+ amdgpu_rpathdir = '$ORIGIN'
+ # Executables are installed in amdgpudir. Add a .. for each
+ # directory name in it.
+ foreach p : amdgpudir.split('/')
+ amdgpu_rpathdir = join_paths(amdgpu_rpathdir, '..')
+ endforeach
+ # Add relative path to libdir
+ amdgpu_rpathdir = join_paths(amdgpu_rpathdir, libdir)
+else
+ amdgpu_rpathdir = ''
+endif
+
foreach prog : amdgpu_progs
test_executables += executable(prog, prog + '.c',
dependencies : amdgpu_deps,
- install_dir : join_paths(libexecdir, 'amdgpu'),
- install_rpath : rpathdir,
+ install_dir : amdgpudir,
+ install_rpath : amdgpu_rpathdir,
install : true)
test_progs += join_paths('amdgpu', prog)
endforeach