Skip to content

Commit

Permalink
Fix Eyescale#512: Add COMMON_DISABLE_WERROR option
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Eilemann authored and Stefan Eilemann committed Oct 11, 2016
1 parent 483f0eb commit d9dea0e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CommonCompiler.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2012-2014 Fabien Delalondre <fabien.delalondre@epfl.ch>
# Copyright (c) 2012-2016 Fabien Delalondre <fabien.delalondre@epfl.ch>
# Stefan.Eilemann@epfl.ch
#
# Sets compiler optimization, definition and warnings according to
Expand Down Expand Up @@ -40,6 +40,7 @@ endif()

option(COMMON_WARN_DEPRECATED "Enable compiler deprecation warnings" ON)
option(COMMON_ENABLE_CXX11_STDLIB "Enable C++11 stdlib" OFF)
option(COMMON_DISABLE_WERROR "Disable -Werror flag" OFF)

if(COMMON_WARN_DEPRECATED)
add_definitions(-DWARN_DEPRECATED) # projects have to pick this one up
Expand Down Expand Up @@ -86,7 +87,7 @@ if(CMAKE_COMPILER_IS_GCC OR CMAKE_COMPILER_IS_CLANG)
set(COMMON_CXX_FLAGS
-Wnon-virtual-dtor -Wsign-promo -Wvla -fno-strict-aliasing)

if(NOT WIN32 AND NOT XCODE_VERSION)
if(NOT WIN32 AND NOT XCODE_VERSION AND NOT COMMON_DISABLE_WERROR)
list(APPEND COMMON_C_FLAGS -Werror)
endif()

Expand Down

0 comments on commit d9dea0e

Please sign in to comment.