Skip to content

Commit 16bad12

Browse files
committed
meson: generalize finding to not hard error but disaber(). add windows msys2 defaults
1 parent 98c4c0a commit 16bad12

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

.github/workflows/ci.yml renamed to .github/workflows/ci_linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ci
1+
name: ci_linux
22

33
on: [push, pull_request]
44

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![DOI](https://zenodo.org/badge/128736984.svg)](https://zenodo.org/badge/latestdoi/128736984)
22

3-
[![Actions Status](https://github.com/scivision/oo_hdf5_fortran/workflows/ci/badge.svg)](https://github.com/scivision/oo_hdf5_fortran/actions)
3+
[![Actions Status](https://github.com/scivision/oo_hdf5_fortran/workflows/ci_linux/badge.svg)](https://github.com/scivision/oo_hdf5_fortran/actions)
44
[![Actions Status](https://github.com/scivision/oo_hdf5_fortran/workflows/ci_mac/badge.svg)](https://github.com/scivision/oo_hdf5_fortran/actions)
55

66
# Object-oriented Fortran 2018 HDF5 interface
@@ -54,11 +54,6 @@ If HDF5 isn't found, you may need to specify on the command line:
5454
* `-Dh5libdir`: HDF5 library directory
5555
* `-Dh5incdir`: HDF5 include directory
5656

57-
For MSYS2 this might be like:
58-
59-
```posh
60-
meson build -Dh5libdir=c:/msys64/mingw64/lib -Dh5incdir=c:/msys64/mingw64/include/static
61-
```
6257

6358
### CMake
6459

cmake/meson.build

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ if h5libdir == ''
3030
# assume homebrew
3131
h5libdir = '/usr/local/opt/hdf5/lib'
3232
h5incdir = include_directories('/usr/local/opt/hdf5/include')
33+
elif os == 'windows'
34+
# assume MSYS2
35+
h5libdir = 'c:/msys64/mingw64/lib'
36+
if get_option('default_library') == 'static'
37+
h5incdir = include_directories('c:/msys64/mingw64/include/static')
38+
else
39+
h5incdir = include_directories('c:/msys64/mingw64/include/shared')
40+
endif
3341
else
3442
h5libdir = []
3543
endif
@@ -45,12 +53,9 @@ foreach name : ['hdf5', 'hdf5_fortran', 'hdf5_hl', 'hdf5_hl_fortran', # msys2 na
4553
endif
4654
endforeach
4755

48-
if hdf5_libs.length() == 0
49-
error('could not find HDF5 library')
50-
endif
51-
52-
hdf5 = hdf5_libs
5356

54-
if not fc.links('use h5lt; end', dependencies: hdf5, include_directories: h5incdir, name: 'HDF5')
55-
warning('HDF5 possible linking problems: ' + h5run.stdout() + h5run.stderr())
57+
if not fc.links('use h5lt; end', dependencies: hdf5_libs, include_directories: h5incdir, name: 'HDF5')
58+
hdf5 = disabler()
59+
else
60+
hdf5 = declare_dependency(dependencies: hdf5_libs, include_directories: h5incdir)
5661
endif

meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ subdir('src')
1010
ooh5 = library('oohdf5',
1111
sources: hdf5_src,
1212
dependencies: hdf5,
13-
include_directories: h5incdir,
1413
install: true)
1514

1615
# --- testing

0 commit comments

Comments
 (0)