Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Supernovae should not set specific settings, which are controled by their own flags
[simgrid.git] / buildtools / Cmake / Flags.cmake
1 set(warnCFLAGS "")
2 set(optCFLAGS "")
3
4 if(NOT __VISUALC__ AND NOT __BORLANDC__)
5         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}-g3")
6 else(NOT __VISUALC__ AND NOT __BORLANDC__)
7     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}/Zi")
8     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}/Zi")
9 endif(NOT __VISUALC__ AND NOT __BORLANDC__)
10
11 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${custom_flags}")
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         find_program(GCOV_PATH gcov)
25         if(GCOV_PATH)
26                 SET(COVERAGE_COMMAND "${GCOV_PATH}" CACHE TYPE FILEPATH FORCE)
27                 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
28                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
29                 add_definitions(-fprofile-arcs -ftest-coverage)
30                 endif(GCOV_PATH)
31 endif(enable_coverage)
32