diff options
author | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2018-12-06 20:09:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-10 19:09:12 (GMT) |
commit | 10a1477b631d9173a32827a315aebf1941c87564 (patch) | |
tree | 07e582628ada224c880dd8101d567a159cc4c8f0 /Tests/FortranOnly | |
parent | 6092a770f66bff959749170141d44188f4b6f3f1 (diff) | |
download | CMake-10a1477b631d9173a32827a315aebf1941c87564.zip CMake-10a1477b631d9173a32827a315aebf1941c87564.tar.gz CMake-10a1477b631d9173a32827a315aebf1941c87564.tar.bz2 |
CheckFortranSourceRuns: Add module to check if Fortran code runs
Add a Fortran equivalent to the existing `Check{C,CXX}SourceRuns`
modules.
Diffstat (limited to 'Tests/FortranOnly')
-rw-r--r-- | Tests/FortranOnly/CMakeLists.txt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index 59e6d59..77f6041 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -70,8 +70,15 @@ if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL XL) include(CheckFortranCompilerFlag) CHECK_Fortran_COMPILER_FLAG(-_this_is_not_a_flag_ Fortran_BOGUS_FLAG) if (Fortran_BOGUS_FLAG) - message (SEND_ERROR "CHECK_Fortran_COMPILER_FLAG() succeeded, but should have failed") - endif () + message(SEND_ERROR "CHECK_Fortran_COMPILER_FLAG() succeeded, but should have failed") + endif() + + unset(Fortran_RUN_FLAG CACHE) + include(CheckFortranSourceRuns) + check_fortran_source_runs("program a; end program" Fortran_RUN_FLAG SRC_EXT F90) + if(NOT Fortran_RUN_FLAG) + message(SEND_ERROR "CHECK_Fortran_SOURCE_RUNS() failed") + endif() endif() # Test generation of preprocessed sources. |