Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Flags for coverage.
[simgrid.git] / buildtools / Cmake / Flags.cmake
1 set(warnCFLAGS "")
2 set(optCFLAGS "")
3
4 if(NOT WIN32)
5         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-g3")
6 endif(NOT WIN32)
7
8 if(enable_supernovae)
9         set(warnCFLAGS "-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror ")
10         set(optCFLAGS "-O3 -finline-functions -funroll-loops -fno-strict-aliasing ")
11 endif(enable_supernovae)
12
13 if(enable_compile_warnings)
14         set(warnCFLAGS "-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wcomment -Wformat -Wwrite-strings -Wno-unused-function -Wno-unused-parameter -Wno-strict-aliasing -Wno-format-nonliteral -Werror ")
15 endif(enable_compile_warnings)
16
17 if(enable_compile_optimizations)
18         set(optCFLAGS "-O3 -finline-functions -funroll-loops -fno-strict-aliasing ")
19 endif(enable_compile_optimizations)
20
21 set(CMAKE_C_FLAGS "${optCFLAGS}${warnCFLAGS}${CMAKE_C_FLAGS}")
22
23 if(enable_coverage)
24         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
25         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
26         set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
27 endif(enable_coverage)
28