From 45513c1a69853372a1abf137adea262e5df7df71 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 18 Sep 2023 19:41:47 -0400 Subject: Tests/FortranModules: move issue 25112 fix from FortranOnly It involves modules, so it belongs in the `FortranModules` test set. --- Tests/FortranModules/CMakeLists.txt | 2 ++ Tests/FortranModules/Issue25112/CMakeLists.txt | 4 ++++ Tests/FortranModules/Issue25112/objmain.f90 | 5 +++++ Tests/FortranModules/Issue25112/objmod.f90 | 7 +++++++ Tests/FortranOnly/CMakeLists.txt | 6 ------ Tests/FortranOnly/objmain.f90 | 5 ----- Tests/FortranOnly/objmod.f90 | 7 ------- 7 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 Tests/FortranModules/Issue25112/CMakeLists.txt create mode 100644 Tests/FortranModules/Issue25112/objmain.f90 create mode 100644 Tests/FortranModules/Issue25112/objmod.f90 delete mode 100644 Tests/FortranOnly/objmain.f90 delete mode 100644 Tests/FortranOnly/objmod.f90 diff --git a/Tests/FortranModules/CMakeLists.txt b/Tests/FortranModules/CMakeLists.txt index 5c76132..487491f 100644 --- a/Tests/FortranModules/CMakeLists.txt +++ b/Tests/FortranModules/CMakeLists.txt @@ -125,3 +125,5 @@ add_subdirectory(Executable) if(CMake_TEST_Fortran_SUBMODULES) add_subdirectory(Submodules) endif() + +add_subdirectory(Issue25112) diff --git a/Tests/FortranModules/Issue25112/CMakeLists.txt b/Tests/FortranModules/Issue25112/CMakeLists.txt new file mode 100644 index 0000000..cf0c69e --- /dev/null +++ b/Tests/FortranModules/Issue25112/CMakeLists.txt @@ -0,0 +1,4 @@ +set(CMAKE_Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/include") +add_library(objmod OBJECT objmod.f90) +add_executable(objmain objmain.f90) +target_link_libraries(objmain PRIVATE objmod) diff --git a/Tests/FortranModules/Issue25112/objmain.f90 b/Tests/FortranModules/Issue25112/objmain.f90 new file mode 100644 index 0000000..d41d454 --- /dev/null +++ b/Tests/FortranModules/Issue25112/objmain.f90 @@ -0,0 +1,5 @@ +program main + use objmod, only : hello + implicit none + call hello() +end program diff --git a/Tests/FortranModules/Issue25112/objmod.f90 b/Tests/FortranModules/Issue25112/objmod.f90 new file mode 100644 index 0000000..6b79cc7 --- /dev/null +++ b/Tests/FortranModules/Issue25112/objmod.f90 @@ -0,0 +1,7 @@ +module objmod + implicit none +contains + subroutine hello() + print '(a)', "hello world" + end subroutine hello +end module objmod diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index dfc28dd..02bf2b8 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -186,9 +186,3 @@ if(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF AND set_property(SOURCE no_preprocess_source_upper.F no_preprocess_source_fpp.fpp PROPERTY Fortran_PREPROCESS OFF) endif() - -# Issue 25112 -set(CMAKE_Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/include") -add_library(objmod OBJECT objmod.f90) -add_executable(objmain objmain.f90) -target_link_libraries(objmain PRIVATE objmod) diff --git a/Tests/FortranOnly/objmain.f90 b/Tests/FortranOnly/objmain.f90 deleted file mode 100644 index d41d454..0000000 --- a/Tests/FortranOnly/objmain.f90 +++ /dev/null @@ -1,5 +0,0 @@ -program main - use objmod, only : hello - implicit none - call hello() -end program diff --git a/Tests/FortranOnly/objmod.f90 b/Tests/FortranOnly/objmod.f90 deleted file mode 100644 index 6b79cc7..0000000 --- a/Tests/FortranOnly/objmod.f90 +++ /dev/null @@ -1,7 +0,0 @@ -module objmod - implicit none -contains - subroutine hello() - print '(a)', "hello world" - end subroutine hello -end module objmod -- cgit v0.12