File: CheckCompilerSupport.cmake

package info (click to toggle)
dbcsr 2.8.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 39,836 kB
  • sloc: fortran: 54,534; ansic: 7,060; python: 3,482; cpp: 2,431; sh: 1,639; f90: 1,178; lisp: 689; makefile: 633
file content (19 lines) | stat: -rw-r--r-- 726 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
include(CheckFortranSourceCompiles)

set(CHECK_PROGRAMS f2008-norm2.f90 f2008-block_construct.f90
                   f2008-contiguous.f90 f95-reshape-order-allocatable.f90)

foreach (prog ${CHECK_PROGRAMS})
  get_filename_component(prog_ext ${prog} EXT) # get the src extension to pass
                                               # along
  get_filename_component(prog_name ${prog} NAME_WE)

  file(READ "${CMAKE_CURRENT_LIST_DIR}/compiler-tests/${prog}" prog_src)
  CHECK_Fortran_SOURCE_COMPILES("${prog_src}" "${prog_name}" SRC_EXT
                                "${prog_ext}")

  if (NOT ${prog_name})
    message(
      FATAL_ERROR "Your compiler does not support all required F2008 features")
  endif ()
endforeach ()