diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bc642a66..72cf3a979 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,21 +31,20 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU) add_compile_options(-pedantic-errors) endif() add_compile_options(-std=f2018) -elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) - add_compile_options(-warn declarations,general,usage,interfaces,unused) - if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0) - add_compile_options(-stand f15) +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^Intel") + if(WIN32) + add_compile_options(/warn:declarations,general,usage,interfaces,unused) + add_compile_options(/stand:f18) else() + add_compile_options(-warn declarations,general,usage,interfaces,unused) add_compile_options(-stand f18) endif() -elseif(CMAKE_Fortran_COMPILER_ID STREQUAL PGI) - add_compile_options(-Mdclchk) endif() # --- compiler feature checks include(CheckFortranSourceCompiles) include(CheckFortranSourceRuns) -check_fortran_source_runs("i=0; error stop i; end" f18errorstop SRC_EXT f90) +check_fortran_source_runs("i=0; error stop i; end" f18errorstop) check_fortran_source_compiles("real, allocatable :: array(:, :, :, :, :, :, :, :, :, :); end" f03rank SRC_EXT f90) check_fortran_source_runs("use, intrinsic :: iso_fortran_env, only : real128; real(real128) :: x; x = x+1; end" f03real128)