summaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/hdf5.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2024-01-17 13:23:56 -0500
committerEli Schwartz <eschwartz93@gmail.com>2024-01-31 21:40:14 -0500
commitf5da446bb91f33cb0a67f95d08da70ce12fa042f (patch)
tree211318019d98990038650f53e544fd8cc4c92323 /mesonbuild/dependencies/hdf5.py
parent55d30b61ffadb014abb0c814c039ebebfc7df347 (diff)
downloadmeson-f5da446bb91f33cb0a67f95d08da70ce12fa042f.tar.gz
dependencies: hdf5: mark configtool dependency not-found for cmake build
When hdf5 is built with cmake instead of autotools, it makes a number of weird changes. What we care about in particular is that h5cc exists but doesn't work -- it happily ignores -show and tries to compile stuff, then leaves us with a dependency that has no libraries, and fails when running `ninja`. See: #12748
Diffstat (limited to 'mesonbuild/dependencies/hdf5.py')
-rw-r--r--mesonbuild/dependencies/hdf5.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/hdf5.py b/mesonbuild/dependencies/hdf5.py
index a00b5988b..622653025 100644
--- a/mesonbuild/dependencies/hdf5.py
+++ b/mesonbuild/dependencies/hdf5.py
@@ -122,13 +122,20 @@ class HDF5ConfigToolDependency(ConfigToolDependency):
# and then without -c to get the link arguments.
args = self.get_config_value(['-show', '-c'], 'args')[1:]
args += self.get_config_value(['-show', '-noshlib' if self.static else '-shlib'], 'args')[1:]
+ found = False
for arg in args:
if arg.startswith(('-I', '-f', '-D')) or arg == '-pthread':
self.compile_args.append(arg)
elif arg.startswith(('-L', '-l', '-Wl')):
self.link_args.append(arg)
+ found = True
elif Path(arg).is_file():
self.link_args.append(arg)
+ found = True
+
+ # cmake h5cc is broken
+ if not found:
+ raise DependencyException('HDF5 was built with cmake instead of autotools, and h5cc is broken.')
def _sanitize_version(self, ver: str) -> str:
v = re.search(r'\s*HDF5 Version: (\d+\.\d+\.\d+)', ver)