Skip to content

Commit

Permalink
meson: generalize finding to not hard error but disaber(). add window…
Browse files Browse the repository at this point in the history
…s msys2 defaults
  • Loading branch information
scivision committed Oct 25, 2019
1 parent 98c4c0a commit 16bad12
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: ci_linux

on: [push, pull_request]

Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![DOI](https://zenodo.org/badge/128736984.svg)](https://zenodo.org/badge/latestdoi/128736984)

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

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

For MSYS2 this might be like:

```posh
meson build -Dh5libdir=c:/msys64/mingw64/lib -Dh5incdir=c:/msys64/mingw64/include/static
```

### CMake

Expand Down
19 changes: 12 additions & 7 deletions cmake/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ if h5libdir == ''
# assume homebrew
h5libdir = '/usr/local/opt/hdf5/lib'
h5incdir = include_directories('/usr/local/opt/hdf5/include')
elif os == 'windows'
# assume MSYS2
h5libdir = 'c:/msys64/mingw64/lib'
if get_option('default_library') == 'static'
h5incdir = include_directories('c:/msys64/mingw64/include/static')
else
h5incdir = include_directories('c:/msys64/mingw64/include/shared')
endif
else
h5libdir = []
endif
Expand All @@ -45,12 +53,9 @@ foreach name : ['hdf5', 'hdf5_fortran', 'hdf5_hl', 'hdf5_hl_fortran', # msys2 na
endif
endforeach

if hdf5_libs.length() == 0
error('could not find HDF5 library')
endif

hdf5 = hdf5_libs

if not fc.links('use h5lt; end', dependencies: hdf5, include_directories: h5incdir, name: 'HDF5')
warning('HDF5 possible linking problems: ' + h5run.stdout() + h5run.stderr())
if not fc.links('use h5lt; end', dependencies: hdf5_libs, include_directories: h5incdir, name: 'HDF5')
hdf5 = disabler()
else
hdf5 = declare_dependency(dependencies: hdf5_libs, include_directories: h5incdir)
endif
1 change: 0 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ subdir('src')
ooh5 = library('oohdf5',
sources: hdf5_src,
dependencies: hdf5,
include_directories: h5incdir,
install: true)

# --- testing
Expand Down

0 comments on commit 16bad12

Please sign in to comment.