Skip to content

Commit

Permalink
simplify generation
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jul 15, 2020
1 parent cdb1978 commit b7f6f33
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
8 changes: 2 additions & 6 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
6 changes: 5 additions & 1 deletion src/pathlib.in.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b7f6f33

Please sign in to comment.