diff --git a/CMakeLists.txt b/CMakeLists.txt index 6300a447..4f077fce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ if(NOT CMAKE_BUILD_TYPE) endif() project(h5fortran LANGUAGES C Fortran - VERSION 2.10.2 + VERSION 2.10.3 DESCRIPTION "thin, light object-oriented HDF5 Fortran interface" HOMEPAGE_URL https://github.com/geospace-code/h5fortran) enable_testing() diff --git a/meson.build b/meson.build index 987d5337..254e9345 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('h5fortran', 'fortran', meson_version : '>=0.52.0', - version : '2.10.2', + version : '2.10.3', default_options : ['default_library=static', 'buildtype=release', 'warning_level=3']) subdir('meson') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 33a41b75..22f5cabb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,8 +1,8 @@ if(WIN32) - set(is_abs "if (lge(path(1:1), 'A' .and. lle(path(1:1), 'z') .and. path(2:2) == ':') is_absolute_path = .true.") + set(is_windows .true.) else() - set(is_abs "if(path(1:1) == '/') is_absolute_path=.true.") + set(is_windows .false.) endif() configure_file(pathlib.in.f90 pathlib.f90) diff --git a/src/meson.build b/src/meson.build index 875831bd..eb8c47f3 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,12 +1,8 @@ conf_data = configuration_data() -if os == 'windows' - code = '''if (lge(path(1:1), 'A') .and. lle(path(1:1), 'z') .and. path(2:2) == ':') is_absolute_path = .true.''' -else - code = '''if(path(1:1) == '/') is_absolute_path=.true.''' -endif +is_windows = os == 'windows' ? '.true.' : '.false.' -conf_data.set('is_abs', code) +conf_data.set('is_windows', is_windows) pathlib_src = configure_file( input : 'pathlib.in.f90', output : 'pathlib.f90', diff --git a/src/pathlib.in.f90 b/src/pathlib.in.f90 index fef08c5c..123a8bc8 100644 --- a/src/pathlib.in.f90 +++ b/src/pathlib.in.f90 @@ -28,7 +28,11 @@ pure logical function is_absolute_path(path) is_absolute_path = .false. -@is_abs@ +if(@is_windows@) then + if (lge(path(1:1), 'A') .and. lle(path(1:1), 'z') .and. path(2:2) == ':') is_absolute_path = .true. +else + if(path(1:1) == '/') is_absolute_path=.true. +endif end function