Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 6acb22e9 authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files

Add compiler options when warning, coverage ON

parent e4b604a8
No related branches found
No related tags found
No related merge requests found
...@@ -34,19 +34,19 @@ ...@@ -34,19 +34,19 @@
if (MORSE_ENABLE_WARNING) if (MORSE_ENABLE_WARNING)
if(CMAKE_C_COMPILER_ID MATCHES GNU) if(CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fdiagnostics-show-option")
elseif(CMAKE_C_COMPILER_ID MATCHES Intel) elseif(CMAKE_C_COMPILER_ID MATCHES Intel)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w3 -diag-disable:remark") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w3 -diag-disable:remark")
endif() endif()
if(CMAKE_CXX_COMPILER_ID MATCHES GNU) if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fdiagnostics-show-option")
elseif(CMAKE_CXX_COMPILER_ID MATCHES Intel) elseif(CMAKE_CXX_COMPILER_ID MATCHES Intel)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w3 -diag-disable:remark") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w3 -diag-disable:remark")
endif() endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU) if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wall -fdiagnostics-show-option")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES Intel) elseif(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -warn all -diag-disable:remark") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -warn all -diag-disable:remark")
endif() endif()
...@@ -56,21 +56,21 @@ endif(MORSE_ENABLE_WARNING) ...@@ -56,21 +56,21 @@ endif(MORSE_ENABLE_WARNING)
if (MORSE_ENABLE_COVERAGE) if (MORSE_ENABLE_COVERAGE)
if(CMAKE_C_COMPILER_ID MATCHES GNU) if(CMAKE_C_COMPILER_ID MATCHES GNU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -fno-inline --coverage")
else() else()
message(FATAL_ERROR "Code coverage is only available with the GNU C (gcc)" message(FATAL_ERROR "Code coverage is only available with the GNU C (gcc)"
"\n compiler, please turn MORSE_ENABLE_COVERAGE OFF\n.") "\n compiler, please turn MORSE_ENABLE_COVERAGE OFF\n.")
endif() endif()
if(CMAKE_CXX_COMPILER_ID MATCHES GNU) if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -fno-inline --coverage")
else() else()
message(FATAL_ERROR "Code coverage is only available with the GNU CXX" message(FATAL_ERROR "Code coverage is only available with the GNU CXX"
"\n (g++) compiler, please turn MORSE_ENABLE_COVERAGE OFF\n.") "\n (g++) compiler, please turn MORSE_ENABLE_COVERAGE OFF\n.")
endif() endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES GNU) if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} --coverage") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fPIC -fno-inline --coverage")
else() else()
message(FATAL_ERROR "Code coverage is only available with the GNU" message(FATAL_ERROR "Code coverage is only available with the GNU"
"\n Fortran (gfortran) compiler, please turn MORSE_ENABLE_COVERAGE" "\n Fortran (gfortran) compiler, please turn MORSE_ENABLE_COVERAGE"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment