Use correct method for selecting compiler names. (#34175)

This commit is contained in:
wspear 2022-12-02 15:02:24 -08:00 committed by GitHub
parent 241a8f6be6
commit 8f5209063d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,14 +164,13 @@ def set_compiler_options(self, spec):
if compiler_path:
compiler_path = compiler_path + "/bin/"
os.environ["PATH"] = ":".join([compiler_path, os.environ["PATH"]])
compiler_options = [
"-c++=%s" % self.compiler.cxx_names[0],
"-cc=%s" % self.compiler.cc_names[0],
"-c++=%s" % os.path.basename(self.compiler.cxx),
"-cc=%s" % os.path.basename(self.compiler.cc),
]
if "+fortran" in spec and self.compiler.fc:
compiler_options.append("-fortran=%s" % self.compiler.fc_names[0])
compiler_options.append("-fortran=%s" % os.path.basename(self.compiler.fc))
##########