mirror of
https://github.com/reactos/CMake.git
synced 2025-01-19 18:02:20 +00:00
ENH: Added Fortran 90 test if the platform supports it.
This commit is contained in:
parent
23dfc9440a
commit
eb9164bf0e
@ -6,3 +6,10 @@ 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)
|
||||
|
||||
IF(CMAKE_Fortran_COMPILER_SUPPORTS_F90 AND CMAKE_GENERATOR_NEW)
|
||||
ADD_EXECUTABLE(test_module
|
||||
test_module_main.f90
|
||||
test_module_implementation.f90
|
||||
test_module_interface.f90)
|
||||
ENDIF(CMAKE_Fortran_COMPILER_SUPPORTS_F90 AND CMAKE_GENERATOR_NEW)
|
||||
|
6
Tests/Fortran/test_module_implementation.f90
Normal file
6
Tests/Fortran/test_module_implementation.f90
Normal file
@ -0,0 +1,6 @@
|
||||
FUNCTION TEST_MODULE_FUNCTION(A,B)
|
||||
REAL :: TEST_MODULE_FUNCTION
|
||||
REAL, INTENT(IN) :: A
|
||||
REAL, INTENT(IN) :: B
|
||||
TEST_MODULE_FUNCTION = A + B
|
||||
END FUNCTION TEST_MODULE_FUNCTION
|
9
Tests/Fortran/test_module_interface.f90
Normal file
9
Tests/Fortran/test_module_interface.f90
Normal file
@ -0,0 +1,9 @@
|
||||
MODULE TEST_MODULE
|
||||
INTERFACE
|
||||
FUNCTION TEST_MODULE_FUNCTION(A,B)
|
||||
REAL :: TEST_MODULE_FUNCTION
|
||||
REAL, INTENT(IN) :: A
|
||||
REAL, INTENT(IN) :: B
|
||||
END FUNCTION TEST_MODULE_FUNCTION
|
||||
END INTERFACE
|
||||
END MODULE TEST_MODULE
|
4
Tests/Fortran/test_module_main.f90
Normal file
4
Tests/Fortran/test_module_main.f90
Normal file
@ -0,0 +1,4 @@
|
||||
PROGRAM MAINF90
|
||||
USE TEST_MODULE
|
||||
PRINT *,'Sum is',TEST_MODULE_FUNCTION(1., 2.)
|
||||
END PROGRAM MAINF90
|
Loading…
x
Reference in New Issue
Block a user