From eb3d02e35121fc91b8a70eafcf9a4a55c3eb59a0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 23 Oct 2009 08:24:51 -0400 Subject: Test all target types in Fortran This teaches the Fortran test to try all basic target types (archive, shared lib, exe) with Fortran-only sources. --- Tests/Fortran/CMakeLists.txt | 5 ++++- Tests/Fortran/hello.f | 4 ++-- Tests/Fortran/testf.f | 7 +++++++ Tests/Fortran/world.f | 6 ++++++ 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 Tests/Fortran/testf.f create mode 100644 Tests/Fortran/world.f diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index adcadd4..3e890c8 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -7,8 +7,11 @@ message("CMAKE_Fortran_COMPILER_INIT = ${CMAKE_Fortran_COMPILER_INIT}") message("CMAKE_Fortran_COMPILER_FULLPATH = ${CMAKE_Fortran_COMPILER_FULLPATH}") message("CMAKE_Fortran_COMPILER = ${CMAKE_Fortran_COMPILER}") message("CMAKE_Fortran_FLAGS = ${CMAKE_Fortran_FLAGS}") -add_executable(testf hello.f) +add_library(hello STATIC hello.f) +add_library(world SHARED world.f) +add_executable(testf testf.f) +target_link_libraries(testf hello world) function(test_fortran_c_interface_module) message(STATUS "Testing FortranCInterface module") diff --git a/Tests/Fortran/hello.f b/Tests/Fortran/hello.f index c9ee3c2..aa0de77 100644 --- a/Tests/Fortran/hello.f +++ b/Tests/Fortran/hello.f @@ -1,6 +1,6 @@ - PROGRAM GREETINGS + SUBROUTINE HELLO - PRINT *, 'Real programmers write Fortran!' + PRINT *, 'Hello' END diff --git a/Tests/Fortran/testf.f b/Tests/Fortran/testf.f new file mode 100644 index 0000000..abf6c6d --- /dev/null +++ b/Tests/Fortran/testf.f @@ -0,0 +1,7 @@ + PROGRAM TESTF + + CALL HELLO() + CALL WORLD() + + END + diff --git a/Tests/Fortran/world.f b/Tests/Fortran/world.f new file mode 100644 index 0000000..0487dff --- /dev/null +++ b/Tests/Fortran/world.f @@ -0,0 +1,6 @@ + SUBROUTINE WORLD + + PRINT *, 'World!' + + END + -- cgit v0.12