summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorArkadiusz Hiler <arkadiusz.hiler@intel.com>2018-08-13 13:16:22 +0300
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2018-08-13 13:59:44 +0300
commit6cc5ebf11ff6327720f41bbd0a0bd117d6b9edbf (patch)
tree2114be87f36b0e9c7626708587ac6b60761455d9 /meson.build
parent2cd4ae5ee6b385360644ded41d73e070ea81f116 (diff)
meson: Define all the rpath_dirs in one place
So they are located close to the definitions of the corresponding install_dirs and can be reused easily. 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 'meson.build')
-rw-r--r--meson.build38
1 files changed, 38 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index d45db9ac..7278c438 100644
--- a/meson.build
+++ b/meson.build
@@ -221,9 +221,47 @@ datadir = join_paths(get_option('datadir'), 'igt-gpu-tools')
includedir = get_option('includedir')
libdir = get_option('libdir')
libexecdir = join_paths(get_option('libexecdir'), 'igt-gpu-tools')
+amdgpudir = join_paths(libexecdir, 'amdgpu')
mandir = get_option('mandir')
pkgconfigdir = join_paths(libdir, 'pkgconfig')
+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 bindir are pathnames relative to prefix. meson
+ # enforces this.
+
+ # 1. Start from the executable.
+ # 2. Executables are installed in certain dir. Add a .. for each
+ # directory name in it.
+ # 3. Add relative path to libdir.
+
+ bindir_rpathdir = '$ORIGIN'
+ foreach p : bindir.split('/')
+ bindir_rpathdir = join_paths(bindir_rpathdir, '..')
+ endforeach
+ bindir_rpathdir = join_paths(bindir_rpathdir, libdir)
+
+ libexecdir_rpathdir = '$ORIGIN'
+ foreach p : libexecdir.split('/')
+ libexecdir_rpathdir = join_paths(libexecdir_rpathdir, '..')
+ endforeach
+ libexecdir_rpathdir = join_paths(libexecdir_rpathdir, libdir)
+
+ amdgpudir_rpathdir = '$ORIGIN'
+ foreach p : amdgpudir.split('/')
+ amdgpudir_rpathdir = join_paths(amdgpudir_rpathdir, '..')
+ endforeach
+ amdgpudir_rpathdir = join_paths(amdgpudir_rpathdir, libdir)
+else
+ bindir_rpathdir = ''
+ libexecdir_rpathdir = ''
+ amdgpudir_rpathdir = ''
+endif
+
subdir('lib')
if _build_tests
subdir('tests')