From 6c4b2492728cd3fab60bf11feafe3361f02c08c9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 23 Feb 2011 10:34:28 -0500 Subject: Fix Fortran test .def file symbol mangling Commit 6a61a8a5 (Honor module .def files with MinGW tools, 2011-02-21) enabled use of .def files with GNU tools on Windows. Previously the Fortran tests's world.def file was used only for the Intel Fortran Compiler on Windows and contained the symbol name mangled for that compiler. Instead choose a .def file that names the symbol with proper mangling for the compiler in use. --- Tests/Fortran/CMakeLists.txt | 13 ++++++++++++- Tests/Fortran/world.def | 2 -- Tests/Fortran/world_gnu.def | 2 ++ Tests/Fortran/world_icl.def | 2 ++ 4 files changed, 16 insertions(+), 3 deletions(-) delete mode 100644 Tests/Fortran/world.def create mode 100644 Tests/Fortran/world_gnu.def create mode 100644 Tests/Fortran/world_icl.def 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.def b/Tests/Fortran/world.def deleted file mode 100644 index ead7710..0000000 --- a/Tests/Fortran/world.def +++ /dev/null @@ -1,2 +0,0 @@ -EXPORTS - 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_icl.def b/Tests/Fortran/world_icl.def new file mode 100644 index 0000000..ead7710 --- /dev/null +++ b/Tests/Fortran/world_icl.def @@ -0,0 +1,2 @@ +EXPORTS + WORLD -- cgit v0.12