Merge topic 'mingw-module-definition'
6c4b249
Fix Fortran test .def file symbol mangling7616216
Pass .def files directly to MinGW tools (#9997)
This commit is contained in:
commit
307bdadadc
|
@ -43,7 +43,7 @@ endif()
|
||||||
set(CMAKE_DL_LIBS "")
|
set(CMAKE_DL_LIBS "")
|
||||||
set(CMAKE_LIBRARY_PATH_FLAG "-L")
|
set(CMAKE_LIBRARY_PATH_FLAG "-L")
|
||||||
set(CMAKE_LINK_LIBRARY_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_LINK_LIBRARY_SUFFIX "")
|
||||||
set(CMAKE_CREATE_WIN32_EXE "-mwindows")
|
set(CMAKE_CREATE_WIN32_EXE "-mwindows")
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,19 @@ elseif("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")
|
||||||
endif()
|
endif()
|
||||||
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(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)
|
add_executable(testf testf.f)
|
||||||
target_link_libraries(testf hello world)
|
target_link_libraries(testf hello world)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
EXPORTS
|
||||||
|
world_
|
Loading…
Reference in New Issue