diff options
author | Brad King <brad.king@kitware.com> | 2019-01-15 18:15:37 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-15 18:15:44 (GMT) |
commit | bf1a1caefeceaaad8f86e613e086b244a569456b (patch) | |
tree | 2d1ead222b23bfa0d2b853abcdd9a94b180f574d /Tests | |
parent | 11e43a19a47797ed539924022d7c54b2f92125e9 (diff) | |
parent | 10a1477b631d9173a32827a315aebf1941c87564 (diff) | |
download | CMake-bf1a1caefeceaaad8f86e613e086b244a569456b.zip CMake-bf1a1caefeceaaad8f86e613e086b244a569456b.tar.gz CMake-bf1a1caefeceaaad8f86e613e086b244a569456b.tar.bz2 |
Merge topic 'check-fortran-run'
10a1477b63 CheckFortranSourceRuns: Add module to check if Fortran code runs
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2714
Diffstat (limited to 'Tests')
-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. |