Skip to content

Commit 09d312c

Browse files
committed
cmake: correct intel compiler options
1 parent 233d871 commit 09d312c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

CMakeLists.txt

+6-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
3131
add_compile_options(-pedantic-errors)
3232
endif()
3333
add_compile_options(-std=f2018)
34-
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
35-
add_compile_options(-warn declarations,general,usage,interfaces,unused)
36-
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
37-
add_compile_options(-stand f15)
34+
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^Intel")
35+
if(WIN32)
36+
add_compile_options(/warn:declarations,general,usage,interfaces,unused)
37+
add_compile_options(/stand:f18)
3838
else()
39+
add_compile_options(-warn declarations,general,usage,interfaces,unused)
3940
add_compile_options(-stand f18)
4041
endif()
4142
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL PGI)
@@ -45,7 +46,7 @@ endif()
4546
# --- compiler feature checks
4647
include(CheckFortranSourceCompiles)
4748
include(CheckFortranSourceRuns)
48-
check_fortran_source_runs("i=0; error stop i; end" f18errorstop SRC_EXT f90)
49+
check_fortran_source_runs("i=0; error stop i; end" f18errorstop)
4950
check_fortran_source_compiles("real, allocatable :: array(:, :, :, :, :, :, :, :, :, :); end" f03rank SRC_EXT f90)
5051
check_fortran_source_runs("use, intrinsic :: iso_fortran_env, only : real128; real(real128) :: x; x = x+1; end" f03real128)
5152

0 commit comments

Comments
 (0)