aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-02-23 11:27:03 -0500
committerXavier Claessens <xclaesse@gmail.com>2022-02-28 09:03:27 -0500
commitac4f8d0088e7be5fc37f4611a7fadb2361c945f2 (patch)
treebe48dcf3bce16943902cedd39e34238a3aa1797b /mesonbuild/backend
parent24f224777de7a54a1334c820509bef0aa9b37678 (diff)
downloadmeson-ac4f8d0088e7be5fc37f4611a7fadb2361c945f2.zip
meson-ac4f8d0088e7be5fc37f4611a7fadb2361c945f2.tar.gz
meson-ac4f8d0088e7be5fc37f4611a7fadb2361c945f2.tar.bz2
devenv: Do not prepend empty list to PATH and LD_LIBRARY_PATH
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/backends.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 1bb775d..dae9c47 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -1834,11 +1834,13 @@ class Backend:
# LD_LIBRARY_PATH. This allows running system applications using
# that library.
library_paths.add(tdir)
- if mesonlib.is_windows() or mesonlib.is_cygwin():
- extra_paths.update(library_paths)
- elif mesonlib.is_osx():
- env.prepend('DYLD_LIBRARY_PATH', list(library_paths))
- else:
- env.prepend('LD_LIBRARY_PATH', list(library_paths))
- env.prepend('PATH', list(extra_paths))
+ if library_paths:
+ if mesonlib.is_windows() or mesonlib.is_cygwin():
+ extra_paths.update(library_paths)
+ elif mesonlib.is_osx():
+ env.prepend('DYLD_LIBRARY_PATH', list(library_paths))
+ else:
+ env.prepend('LD_LIBRARY_PATH', list(library_paths))
+ if extra_paths:
+ env.prepend('PATH', list(extra_paths))
return env