Commit 7253ccb6 authored by Brad King's avatar Brad King
Browse files

cmake: Add macro to check for Fortran submodules support

parent e131887a
......@@ -199,3 +199,29 @@ function(SetupTestPipeline basename pipeline do_setup)
endforeach()
endfunction()
macro(adios2_check_fortran_submodules var)
include(CheckFortranSourceCompiles)
CHECK_Fortran_SOURCE_COMPILES([[
module foo
interface bar
module subroutine bar_integer(x)
integer, intent(in) :: x
end subroutine
module subroutine bar_real(x)
real, intent(in) :: x
end subroutine
end interface
end module
submodule ( foo ) sub
contains
module subroutine bar_integer(x)
integer, intent(in) :: x
end subroutine
module subroutine bar_real(x)
real, intent(in) :: x
end subroutine
end submodule
program main
end program
]] ${var} SRC_EXT F90)
endmacro()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment