aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/ninjabackend.py
diff options
context:
space:
mode:
authorAdam C. Foltzer <acfoltzer@galois.com>2017-06-14 11:50:35 -0700
committerAdam C. Foltzer <acfoltzer@galois.com>2017-06-14 11:50:35 -0700
commit35fae9d019352dcef01a44944d0096c4c33bbda0 (patch)
tree5a5802cf9e8a580d55f3f1dc8e5d156f19d93c3f /mesonbuild/backend/ninjabackend.py
parentf4d13e180fad89aaae863b6ae057b8d94ec25ef7 (diff)
downloadmeson-35fae9d019352dcef01a44944d0096c4c33bbda0.zip
meson-35fae9d019352dcef01a44944d0096c4c33bbda0.tar.gz
meson-35fae9d019352dcef01a44944d0096c4c33bbda0.tar.bz2
fix failing Rust test cases
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r--mesonbuild/backend/ninjabackend.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 8da75c0..40f0918 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -1188,8 +1188,21 @@ int dummy;
# against are dynamic, otherwise we'll end up with
# multiple implementations of crates
args += ['-C', 'prefer-dynamic']
+
# build the usual rpath arguments as well...
+
+ # Set runtime-paths so we can run executables without needing to set
+ # LD_LIBRARY_PATH, etc in the environment. Doesn't work on Windows.
+ if '/' in target.name or '\\' in target.name:
+ # Target names really should not have slashes in them, but
+ # unfortunately we did not check for that and some downstream projects
+ # now have them. Once slashes are forbidden, remove this bit.
+ target_slashname_workaround_dir = os.path.join(os.path.split(target.name)[0],
+ self.get_target_dir(target))
+ else:
+ target_slashname_workaround_dir = self.get_target_dir(target)
rpath_args = rustc.build_rpath_args(self.environment.get_build_dir(),
+ target_slashname_workaround_dir,
self.determine_rpath_dirs(target),
target.install_rpath)
# ... but then add rustc's sysroot to account for rustup