Skip to content

Commit e2a9871

Browse files
committed
meson: add shared/static CI
v1.3.0 version bump
1 parent 5ac4b08 commit e2a9871

File tree

5 files changed

+32
-8
lines changed

5 files changed

+32
-8
lines changed

.github/workflows/ci_linux.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212

13-
linuxMeson:
13+
linuxMesonStatic:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v1
@@ -19,7 +19,7 @@ jobs:
1919
python-version: '3.x'
2020
- run: python -m pip install meson
2121
- run: sudo apt install -yq --no-install-recommends ninja-build gfortran libhdf5-dev
22-
- run: meson setup build
22+
- run: meson setup build --default-library=static
2323
env:
2424
FC: gfortran
2525
- run: meson test -C build -v
@@ -29,6 +29,26 @@ jobs:
2929
name: Linux_Meson_Testlog
3030
path: build/meson-logs/testlog.txt
3131

32+
linuxMesonShared:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v1
36+
- uses: actions/setup-python@v1
37+
with:
38+
python-version: '3.x'
39+
- run: python -m pip install meson
40+
- run: sudo apt install -yq --no-install-recommends ninja-build gfortran libhdf5-dev
41+
- run: meson setup build --default-library=shared
42+
env:
43+
FC: gfortran
44+
- run: meson test -C build -v
45+
- uses: actions/upload-artifact@v1
46+
if: failure()
47+
with:
48+
name: Linux_Meson_Testlog
49+
path: build/meson-logs/testlog.txt
50+
51+
3252
linuxCmakeStatic:
3353
runs-on: ubuntu-latest
3454
steps:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ if(NOT CMAKE_BUILD_TYPE)
44
endif()
55
project(hdf5iface
66
LANGUAGES Fortran
7-
VERSION 1.2.0
7+
VERSION 1.3.0
88
HOMEPAGE_URL https://github.com/scivision/h5fortran)
99
enable_testing()
1010

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Object-oriented Fortran 2018 HDF5 interface
77

88
Straightforward single-file/module access to HDF5.
9-
Designed for easy use as a Meson "subproject" or CMake "ExternalProject".
9+
Designed for easy use as a Meson "subproject" or CMake "ExternalProject" using **static** or **shared** linking.
1010
Uses Fortran 2008 `submodule` and `error stop` for clean template structure.
1111
This easy-to-use, thin object-oriented modern Fortran library abstracts away the messy parts of HDF5 so that you can read/write various types/ranks of data with a single command.
1212

cmake/meson.build

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ elif fcid == 'pgi'
1515
add_project_arguments('-C', '-Mdclchk', language : 'fortran')
1616
endif
1717

18+
#== find HDF5
1819

19-
hdf5 = dependency('hdf5', language : 'fortran', required: false, disabler: true)
20+
use_static = get_option('default_library') == 'static'
21+
22+
23+
hdf5 = dependency('hdf5', language : 'fortran', required: false, disabler: true, static: use_static)
2024
if fc.links('use h5lt; end', dependencies: hdf5, name: 'HDF5')
2125
h5incdir = []
2226
subdir_done()
@@ -33,7 +37,7 @@ if h5libdir == ''
3337
elif os == 'windows'
3438
# assume MSYS2
3539
h5libdir = 'c:/msys64/mingw64/lib'
36-
if get_option('default_library') == 'static'
40+
if use_static
3741
h5incdir = include_directories('c:/msys64/mingw64/include/static')
3842
else
3943
h5incdir = include_directories('c:/msys64/mingw64/include/shared')
@@ -47,7 +51,7 @@ hdf5_libs = []
4751
foreach name : ['hdf5', 'hdf5_fortran', 'hdf5_hl', 'hdf5_hl_fortran', # msys2 names
4852
'hdf5_serial', 'hdf5_serial_fortran',
4953
'hdf5_serial_hl', 'hdf5_serialhl_fortran']
50-
lib = fc.find_library(name, required: false, dirs: h5libdir)
54+
lib = fc.find_library(name, required: false, dirs: h5libdir, static: use_static)
5155
if lib.found()
5256
hdf5_libs += lib
5357
endif

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
project('Object-oriented HDF5 Fortran', 'fortran',
22
meson_version : '>=0.51.2',
3-
version : '1.2.0',
3+
version : '1.3.0',
44
default_options : ['default_library=static', 'buildtype=release', 'warning_level=3'])
55

66
subdir('cmake')

0 commit comments

Comments
 (0)