diff options
author | scheibelp <scheibel1@llnl.gov> | 2018-03-05 05:43:43 -0800 |
---|---|---|
committer | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2018-03-05 14:43:43 +0100 |
commit | 8b0552bc23e7ec86a02a66cd2a2558b19771c20a (patch) | |
tree | a687b3d374bc73db4d9b9a77d075e9efbe824ddd /lib | |
parent | ca336b60faf9358847de30c6ae4fe4218c19bf05 (diff) | |
download | spack-8b0552bc23e7ec86a02a66cd2a2558b19771c20a.tar.gz spack-8b0552bc23e7ec86a02a66cd2a2558b19771c20a.tar.bz2 spack-8b0552bc23e7ec86a02a66cd2a2558b19771c20a.tar.xz spack-8b0552bc23e7ec86a02a66cd2a2558b19771c20a.zip |
only filter compiler paths for binaries provided by the compiler (#7369)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/mixins.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/spack/spack/mixins.py b/lib/spack/spack/mixins.py index d16f572a4e..d8ffc253fe 100644 --- a/lib/spack/spack/mixins.py +++ b/lib/spack/spack/mixins.py @@ -195,10 +195,15 @@ def filter_compiler_wrappers(*files, **kwargs): x = llnl.util.filesystem.FileFilter(*abs_files) - x.filter(os.environ['CC'], self.compiler.cc, **filter_kwargs) - x.filter(os.environ['CXX'], self.compiler.cxx, **filter_kwargs) - x.filter(os.environ['F77'], self.compiler.f77, **filter_kwargs) - x.filter(os.environ['FC'], self.compiler.fc, **filter_kwargs) + replacements = [ + ('CC', self.compiler.cc), + ('CXX', self.compiler.cxx), + ('F77', self.compiler.f77), + ('FC', self.compiler.fc) + ] + for env_var, compiler_path in replacements: + if env_var in os.environ: + x.filter(os.environ[env_var], compiler_path, **filter_kwargs) # Remove this linking flag if present (it turns RPATH into RUNPATH) x.filter('-Wl,--enable-new-dtags', '', **filter_kwargs) |