diff --git a/CMakeLists.txt b/CMakeLists.txt index 0272d671c..1740cc44f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,25 @@ endif() add_definitions(-DIN_LINPHONE) +if(MSVC) + set(CMAKE_C_FLAGS "/W3") + set(CMAKE_CXX_FLAGS "/W3") +else() + set(CMAKE_C_FLAGS "-Wall -Wuninitialized -Wdeclaration-after-statement -fno-strict-aliasing -Werror") + set(CMAKE_CXX_FLAGS "-Wall -Wuninitialized -Werror") + if(CMAKE_C_COMPILER_ID STREQUAL "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -Wno-array-bounds") + endif() + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -Wno-array-bounds") + endif() + if(APPLE) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unknown-warning-option -Wno-tautological-compare -Wno-unused-function") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unknown-warning-option -Wno-tautological-compare -Wno-unused-function") + endif() +endif() + + set(GETTEXT_PACKAGE "linphone") if(ENABLE_RELATIVE_PREFIX) set(LINPHONE_DATA_DIR ".")