diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index f8e25b5b392..b72e7f514c4 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -361,6 +361,8 @@ endif () if (BUILD_SHARED_LIBS) if(MSVC) set(DLLDEF ${HDF5_F90_SRC_BINARY_DIR}/hdf5_fortrandll.def) + else() + set(DLLDEF "") endif() add_library (${HDF5_F90_LIBSH_TARGET} SHARED ${DLLDEF} ${f90_F_SOURCES_SHARED}) target_include_directories (${HDF5_F90_LIBSH_TARGET} diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 363003e0660..38c742fd714 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -200,6 +200,8 @@ endif () if (BUILD_SHARED_LIBS) if(MSVC) 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}