diff options
author | Brad King <brad.king@kitware.com> | 2014-08-18 15:21:50 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-08-18 15:21:50 (GMT) |
commit | fc8a888d2cee0aeeea3b10a5b764ffb5cf71c212 (patch) | |
tree | 01e9b48a451d93eb85793f4362705fa969909379 /Tests | |
parent | 654c8c08720f96d7e72504a37c4c44bd05cda1f4 (diff) | |
parent | 7386d0d6df1b10f14accf843683eaf8692309c1f (diff) | |
download | CMake-fc8a888d2cee0aeeea3b10a5b764ffb5cf71c212.zip CMake-fc8a888d2cee0aeeea3b10a5b764ffb5cf71c212.tar.gz CMake-fc8a888d2cee0aeeea3b10a5b764ffb5cf71c212.tar.bz2 |
Merge topic 'add-CheckFortranSourceCompiles'
7386d0d6 Add CheckFortranSourceCompiles module (#14656)
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FortranOnly/CMakeLists.txt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt index d57a8b2..a3f83c9 100644 --- a/Tests/FortranOnly/CMakeLists.txt +++ b/Tests/FortranOnly/CMakeLists.txt @@ -43,3 +43,25 @@ add_custom_target(checksayhello ALL COMMAND ${CMAKE_COMMAND} -P ${FortranOnly_SOURCE_DIR}/checksayhello.cmake ) add_dependencies(checksayhello sayhello) + +# Exclude this test on IBM XL for now because the check strangely +# fails with 'ld: 0706-029 Use a number with the -H flag'. +if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL XL) + set(err_log ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log) + file(REMOVE "${err_log}") + include(CheckFortranSourceCompiles) + unset(HAVE_PRINT CACHE) + CHECK_Fortran_SOURCE_COMPILES([[ + PROGRAM TEST_HAVE_PRINT + PRINT *, 'Hello' + END +]] HAVE_PRINT) + if(NOT HAVE_PRINT) + if(EXISTS "${err_log}") + file(READ "${err_log}" err) + endif() + string(REPLACE "\n" "\n " err " ${err}") + message(SEND_ERROR "CHECK_Fortran_SOURCE_COMPILES for HAVE_PRINT failed:\n" + "${err}") + endif() +endif() |