aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kuhn <michael.kuhn@informatik.uni-hamburg.de>2021-02-25 23:47:41 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2021-02-26 23:04:02 +0200
commit2d8d21d5bc9a914a81e91437ff3fda45582b588c (patch)
tree95b3062dc8aece7b0d995b1c5792f562b5deddeb
parentfad0a498fbf2954fe8b4f77f9206d6f53132a00a (diff)
downloadmeson-2d8d21d5bc9a914a81e91437ff3fda45582b588c.zip
meson-2d8d21d5bc9a914a81e91437ff3fda45582b588c.tar.gz
meson-2d8d21d5bc9a914a81e91437ff3fda45582b588c.tar.bz2
hdf5: get include directory from config-tool
hdf5's config-tools will not show compile arguments (including the include directory) if called without `-c`. Make sure to get both the compile and link arguments.
-rw-r--r--mesonbuild/dependencies/hdf5.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/hdf5.py b/mesonbuild/dependencies/hdf5.py
index ad28975..5ac60bb 100644
--- a/mesonbuild/dependencies/hdf5.py
+++ b/mesonbuild/dependencies/hdf5.py
@@ -126,8 +126,11 @@ class HDF5ConfigToolDependency(ConfigToolDependency):
if not self.is_found:
return
- args = self.get_config_value(['-show', '-noshlib' if kwargs.get('static', False) else '-shlib'], 'args')
- for arg in args[1:]:
+ # We first need to call the tool with -c to get the compile arguments
+ # 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 kwargs.get('static', False) else '-shlib'], 'args')[1:]
+ for arg in args:
if arg.startswith(('-I', '-f', '-D')) or arg == '-pthread':
self.compile_args.append(arg)
elif arg.startswith(('-L', '-l', '-Wl')):