Merge topic 'mingw-module-definition'

6c4b249 Fix Fortran test .def file symbol mangling
7616216 Pass .def files directly to MinGW tools (#9997)
This commit is contained in:
Brad King 2011-02-24 08:30:26 -05:00 committed by CMake Topic Stage
commit 307bdadadc
4 changed files with 15 additions and 2 deletions

View File

@ -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")

View File

@ -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)

View File

@ -0,0 +1,2 @@
EXPORTS
world_