Skip to content

Commit

Permalink
Sync hl/fortran files
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF committed Nov 15, 2023
1 parent e54d12b commit de3df57
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
18 changes: 7 additions & 11 deletions hl/fortran/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ if (WIN32 AND MSVC)
set_target_properties (H5HL_buildiface PROPERTIES COMPILE_FLAGS "/MT")
endif ()
endif ()
#set_property(TARGET H5HL_buildiface APPEND PROPERTY
# LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-SUBSYSTEM:CONSOLE>"
#)
if(MSVC)
set_property(TARGET H5HL_buildiface PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE")
endif()
Expand Down Expand Up @@ -182,8 +179,6 @@ if (BUILD_STATIC_LIBS)
PRIVATE "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:${WIN_COMPILE_FLAGS}>"
)
target_link_libraries (${HDF5_HL_F90_LIB_TARGET} PUBLIC ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-SUBSYSTEM:CONSOLE>")
# set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:${WIN_LINK_FLAGS}>")
if(MSVC)
set_property(TARGET ${HDF5_HL_F90_LIB_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
Expand All @@ -198,7 +193,12 @@ if (BUILD_STATIC_LIBS)
add_dependencies(${HDF5_HL_F90_LIB_TARGET} H5HLgen)
endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${HDF5_HL_F90_F_SOURCES_SHARED})
if(WIN32)
set(DLLDEF ${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def)
else()
set(DLLDEF "")
endif()
add_library (${HDF5_HL_F90_LIBSH_TARGET} SHARED ${DLLDEF} ${HDF5_HL_F90_F_SOURCES_SHARED})
target_include_directories (${HDF5_HL_F90_LIBSH_TARGET}
PRIVATE "${HDF5_F90_BINARY_DIR};${CMAKE_Fortran_MODULE_DIRECTORY}/shared;$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_Fortran_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${HDF5_INSTALL_MODULE_DIR}/shared>"
Expand All @@ -214,12 +214,8 @@ if (BUILD_SHARED_LIBS)
PUBLIC ${HDF5_HL_F90_C_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET}
PRIVATE ${LINK_Fortran_LIBS}
)
# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-SUBSYSTEM:CONSOLE>")
# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:${WIN_LINK_FLAGS}>")
# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-DLL>")
# set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} APPEND PROPERTY LINK_FLAGS "$<$<STREQUAL:x${CMAKE_Fortran_SIMULATE_ID},xMSVC>:-DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def>")
if(MSVC)
set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS} -DLL -DEF:${HDF5_HL_F90_SRC_BINARY_DIR}/hdf5_hl_fortrandll.def")
set_property(TARGET ${HDF5_HL_F90_LIBSH_TARGET} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}")
endif()
set_target_properties (${HDF5_HL_F90_LIBSH_TARGET} PROPERTIES
FOLDER libraries/hl/fortran
Expand Down
14 changes: 7 additions & 7 deletions hl/fortran/src/H5LTff.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1115,7 +1115,7 @@ SUBROUTINE h5ltset_attribute_int_f(loc_id,&

f_ptr = C_LOC(buf(1:1))

#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0
#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE
SizeOf_buf_type = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)
#else
SizeOf_buf_type = SIZEOF(buf(1))
Expand Down Expand Up @@ -1165,7 +1165,7 @@ SUBROUTINE h5ltset_attribute_float_f(loc_id,&
INTEGER(size_t) :: SizeOf_buf_type

f_ptr = C_LOC(buf(1))
#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0
#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE
SizeOf_buf_type = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)
#else
SizeOf_buf_type = SIZEOF(buf(1))
Expand Down Expand Up @@ -1216,7 +1216,7 @@ SUBROUTINE h5ltset_attribute_double_f(loc_id,&

f_ptr = C_LOC(buf(1))

#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0
#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE
SizeOf_buf_type = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)
#else
SizeOf_buf_type = SIZEOF(buf(1))
Expand Down Expand Up @@ -1264,7 +1264,7 @@ SUBROUTINE h5ltset_attribute_string_f(loc_id,&

f_ptr = C_LOC(buf(1)(1:1))

#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0
#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE
SizeOf_buf_type = STORAGE_SIZE(buf(1)(1:1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)
#else
SizeOf_buf_type = SIZEOF(buf(1:1)(1:1))
Expand Down Expand Up @@ -1363,7 +1363,7 @@ SUBROUTINE h5ltget_attribute_int_f(loc_id,&

f_ptr = C_LOC(buf(1))

#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0
#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE
SizeOf_buf = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)
#else
SizeOf_buf = SIZEOF(buf(1))
Expand Down Expand Up @@ -1407,7 +1407,7 @@ SUBROUTINE h5ltget_attribute_float_f(loc_id,&
INTEGER(size_t) :: SizeOf_buf

f_ptr = C_LOC(buf(1))
#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0
#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE
SizeOf_buf = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)
#else
SizeOf_buf = SIZEOF(buf(1))
Expand Down Expand Up @@ -1451,7 +1451,7 @@ SUBROUTINE h5ltget_attribute_double_f(loc_id,&
INTEGER(size_t) :: SizeOf_buf

f_ptr = C_LOC(buf(1))
#if H5_FORTRAN_HAVE_STORAGE_SIZE!=0
#ifdef H5_FORTRAN_HAVE_STORAGE_SIZE
SizeOf_buf = STORAGE_SIZE(buf(1), c_size_t)/STORAGE_SIZE(c_char_'a',c_size_t)
#else
SizeOf_buf = SIZEOF(buf(1))
Expand Down

0 comments on commit de3df57

Please sign in to comment.