diff --git a/Modules/Platform/Windows-g77.cmake b/Modules/Platform/Windows-g77.cmake index ad24db678..ed3a07332 100644 --- a/Modules/Platform/Windows-g77.cmake +++ b/Modules/Platform/Windows-g77.cmake @@ -20,4 +20,5 @@ SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-O1") SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "-O2") SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-02 -g") - +SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY + " -o -Wl,--out-implib, ${CMAKE_GNULD_IMAGE_VERSION} ") diff --git a/Modules/Platform/Windows-ifort.cmake b/Modules/Platform/Windows-ifort.cmake index 01848a601..c9624b55a 100644 --- a/Modules/Platform/Windows-ifort.cmake +++ b/Modules/Platform/Windows-ifort.cmake @@ -12,7 +12,7 @@ SET(CMAKE_Fortran_MODDIR_FLAG "-module:") SET(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 1) SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY - "link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out: /dll ${CMAKE_END_TEMP_FILE}") + "link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out: /implib: /dll ${CMAKE_END_TEMP_FILE}") SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY}) @@ -26,7 +26,7 @@ SET(CMAKE_Fortran_COMPILE_OBJECT SET(CMAKE_COMPILE_RESOURCE "rc /fo ") SET(CMAKE_Fortran_LINK_EXECUTABLE - " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe -link ${CMAKE_END_TEMP_FILE}") + " ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /Fe -link /implib: ${CMAKE_END_TEMP_FILE}") INCLUDE(Platform/Windows-Intel) diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index 3e890c877..01c115b3b 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -9,7 +9,7 @@ message("CMAKE_Fortran_COMPILER = ${CMAKE_Fortran_COMPILER}") message("CMAKE_Fortran_FLAGS = ${CMAKE_Fortran_FLAGS}") add_library(hello STATIC hello.f) -add_library(world SHARED world.f) +add_library(world SHARED world.f world.def) add_executable(testf testf.f) target_link_libraries(testf hello world) diff --git a/Tests/Fortran/world.def b/Tests/Fortran/world.def new file mode 100644 index 000000000..ead7710cd --- /dev/null +++ b/Tests/Fortran/world.def @@ -0,0 +1,2 @@ +EXPORTS + WORLD