summaryrefslogtreecommitdiff
path: root/lib/spack/env/cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/env/cc')
-rwxr-xr-xlib/spack/env/cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/env/cc b/lib/spack/env/cc
index 3354448765..699a590912 100755
--- a/lib/spack/env/cc
+++ b/lib/spack/env/cc
@@ -410,10 +410,10 @@ case "$mode" in
ld|ccld)
# Set extra RPATHs
IFS=':' read -ra extra_rpaths <<< "$SPACK_COMPILER_EXTRA_RPATHS"
- for extra_rpath in "${extra_rpaths[@]}"; do
- $add_rpaths && rpaths+=("$extra_rpath")
- libdirs+=("$extra_rpath")
- done
+ libdirs+=("${extra_rpaths[@]}")
+ if [[ "$add_rpaths" != "false" ]] ; then
+ rpaths+=("${extra_rpaths[@]}")
+ fi
# Add SPACK_LDLIBS to args
for lib in "${SPACK_LDLIBS[@]}"; do