Skip to content

Commit db812e5

Browse files
committed
more compiler warnings
1 parent 3951678 commit db812e5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ cmake_minimum_required(VERSION 3.14)
33
project(DonutFortran
44
LANGUAGES C Fortran)
55

6+
if(CMAKE_CXX_COMPILER_ID MATCHES "(Clang|Intel)")
7+
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:-Wall;-Wextra>")
8+
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
9+
add_compile_options("$<$<COMPILE_LANGUAGE:C,CXX>:/W3>")
10+
endif()
11+
612
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
7-
add_compile_options(-Wall -Wextra -Wpedantic
8-
"$<$<COMPILE_LANGUAGE:Fortran>:-Werror=array-bounds;-fcheck=bounds>"
13+
add_compile_options(
14+
"$<$<COMPILE_LANGUAGE:Fortran>:-fimplicit-none;-Wall;-Wextra;-Wpedantic;-Werror=array-bounds;-fcheck=bounds>"
915
"$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:Fortran>>:-fno-backtrace>"
1016
)
17+
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^Intel")
18+
add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:-warn;-traceback;-check>")
1119
endif()
1220

1321
add_executable(donut app/main.f90)

0 commit comments

Comments
 (0)