From 04c8124ec6d4f34eca3ddd9c81737145d9ae730c Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Mon, 16 Nov 2020 16:48:23 +0100 Subject: [PATCH] Strict compilation mode can be turned off --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43a9e3d..0dfd156 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,7 @@ set(VERSION "${PACKAGE_VERSION}") option(ENABLE_SHARED "Build shared library." YES) option(ENABLE_STATIC "Build static library." YES) +option(ENABLE_STRICT "Build with strict compile options." YES) option(ENABLE_TESTS "Enable compilation of the tests." NO) include(GNUInstallDirs) @@ -58,12 +59,15 @@ if(ENABLE_STATIC) list(APPEND BCG729_CPPFLAGS "-DBCG729_STATIC") endif() add_definitions(-DHAVE_CONFIG_H) + if(MSVC) add_definitions("/W3") else() add_definitions("-Wall") - if (NOT IOS) - add_definitions("-Werror") + if(ENABLE_STRICT) + if (NOT IOS) + add_definitions(" -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers ") + endif() endif() if(NOT ENABLE_TESTS) # test access inner functions so maintain visibility if we want to run tests add_definitions("-fvisibility=hidden")