aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/compilers.py
diff options
context:
space:
mode:
authorHemmo Nieminen <hemmo.nieminen@iki.fi>2017-06-20 21:34:28 +0300
committerHemmo Nieminen <hemmo.nieminen@iki.fi>2017-06-29 13:16:38 +0300
commitea79e9496438abe2d1d4ad957cc8bd9324f3d24f (patch)
treeeb44214674cd7edab1406f28c294293348414467 /mesonbuild/compilers/compilers.py
parent7ab774dee535ac2edba1426b103632b2d2d6e38a (diff)
downloadmeson-ea79e9496438abe2d1d4ad957cc8bd9324f3d24f.zip
meson-ea79e9496438abe2d1d4ad957cc8bd9324f3d24f.tar.gz
meson-ea79e9496438abe2d1d4ad957cc8bd9324f3d24f.tar.bz2
Fix a missing path issue causing Python traceback.
A path was missing from a call to os.path.relpath when handling rpaths. Fix this by assuming empty target directory means build root.
Diffstat (limited to 'mesonbuild/compilers/compilers.py')
-rw-r--r--mesonbuild/compilers/compilers.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 579988f..6b5c4a4 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -763,6 +763,10 @@ class Compiler:
# directory. This breaks reproducible builds.
rel_rpaths = []
for p in rpath_paths:
+ # p can be an empty string for build_dir (relative path), but
+ # os.path.relpath() below won't like that.
+ if p == '':
+ p = build_dir
if p == from_dir:
relative = '' # relpath errors out in this case
else: