Skip to content

Commit 652dec1

Browse files
committed
warn that self-test won't work without BLOCK
1 parent bc4a2ec commit 652dec1

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

cmake/compilers.cmake

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,19 @@ endif()
3030

3131
include(CheckFortranSourceCompiles)
3232

33-
check_fortran_source_compiles("
34-
program a
35-
use, intrinsic:: ieee_arithmetic
36-
end"
33+
check_fortran_source_compiles("block; end block; end"
34+
f08block SRC_EXT f90)
35+
if(NOT f08block)
36+
message(WARNING "f2008 BLOCK not supported by " ${CMAKE_Fortran_COMPILER_ID})
37+
endif()
38+
39+
check_fortran_source_compiles("use, intrinsic:: ieee_arithmetic; end"
3740
f08ieee SRC_EXT f90)
38-
3941
if(NOT f08ieee)
40-
message(FATAL_ERROR "IEEE_arithmetic not supported by your compiler")
42+
message(FATAL_ERROR "IEEE_arithmetic not supported by " ${CMAKE_Fortran_COMPILER_ID})
4143
endif()
4244

43-
check_fortran_source_compiles("program a; error stop; end"
45+
check_fortran_source_compiles("error stop; end"
4446
f08errorstop SRC_EXT f90)
4547
if(NOT f08errorstop)
4648
set(f08errorstop 0)

0 commit comments

Comments
 (0)