diff options
-rw-r--r-- | Modules/Platform/Windows-GNU.cmake | 2 | ||||
-rw-r--r-- | Tests/Fortran/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/Fortran/world_gnu.def | 2 | ||||
-rw-r--r-- | Tests/Fortran/world_icl.def (renamed from Tests/Fortran/world.def) | 0 |
4 files changed, 15 insertions, 2 deletions
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 8df0bcb..72b5d62 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -43,7 +43,7 @@ endif() set(CMAKE_DL_LIBS "") set(CMAKE_LIBRARY_PATH_FLAG "-L") set(CMAKE_LINK_LIBRARY_FLAG "-l") -set(CMAKE_LINK_DEF_FILE_FLAG "-Wl,") +set(CMAKE_LINK_DEF_FILE_FLAG "") # Empty string: passing the file is enough set(CMAKE_LINK_LIBRARY_SUFFIX "") set(CMAKE_CREATE_WIN32_EXE "-mwindows") diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index 04563ef..c68d543 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -22,8 +22,19 @@ elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU") endif() endif() +# Pick a module .def file with the properly mangled symbol name. +set(world_def "") +if(WIN32 AND NOT CYGWIN) + if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") + set(world_def world_gnu.def) + elseif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel" OR + "${CMAKE_GENERATOR}" MATCHES "Visual Studio") # Intel plugin + set(world_def world_icl.def) + endif() +endif() + add_library(hello STATIC hello.f) -add_library(world ${_SHARED} world.f world.def) +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_gnu.def b/Tests/Fortran/world_gnu.def new file mode 100644 index 0000000..1617798 --- /dev/null +++ b/Tests/Fortran/world_gnu.def @@ -0,0 +1,2 @@ +EXPORTS + world_ diff --git a/Tests/Fortran/world.def b/Tests/Fortran/world_icl.def index ead7710..ead7710 100644 --- a/Tests/Fortran/world.def +++ b/Tests/Fortran/world_icl.def |