hdf5: fix wrong env values for config tool

pull/12027/head
George Sedov 1 year ago committed by Eli Schwartz
parent 76dd44d6cb
commit b6e306ea5b
  1. 7
      mesonbuild/dependencies/hdf5.py

@ -98,12 +98,15 @@ class HDF5ConfigToolDependency(ConfigToolDependency):
if language == 'c': if language == 'c':
cenv = 'CC' cenv = 'CC'
lenv = 'C'
tools = ['h5cc', 'h5pcc'] tools = ['h5cc', 'h5pcc']
elif language == 'cpp': elif language == 'cpp':
cenv = 'CXX' cenv = 'CXX'
lenv = 'CXX'
tools = ['h5c++', 'h5pc++'] tools = ['h5c++', 'h5pc++']
elif language == 'fortran': elif language == 'fortran':
cenv = 'FC' cenv = 'FC'
lenv = 'F'
tools = ['h5fc', 'h5pfc'] tools = ['h5fc', 'h5pfc']
else: else:
raise DependencyException('How did you get here?') raise DependencyException('How did you get here?')
@ -120,11 +123,11 @@ class HDF5ConfigToolDependency(ConfigToolDependency):
compiler = environment.coredata.compilers[for_machine][language] compiler = environment.coredata.compilers[for_machine][language]
try: try:
os.environ[f'HDF5_{cenv}'] = join_args(compiler.get_exelist()) os.environ[f'HDF5_{cenv}'] = join_args(compiler.get_exelist())
os.environ[f'HDF5_{cenv}LINKER'] = join_args(compiler.get_linker_exelist()) os.environ[f'HDF5_{lenv}LINKER'] = join_args(compiler.get_linker_exelist())
super().__init__(name, environment, nkwargs, language) super().__init__(name, environment, nkwargs, language)
finally: finally:
del os.environ[f'HDF5_{cenv}'] del os.environ[f'HDF5_{cenv}']
del os.environ[f'HDF5_{cenv}LINKER'] del os.environ[f'HDF5_{lenv}LINKER']
if not self.is_found: if not self.is_found:
return return

Loading…
Cancel
Save