Skip to content

Commit 1ded831

Browse files
committed
Compile clang with -Wall -Wshadow -Werror
It was not compiling any of the code with warnings prior to this. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
1 parent c4ccab3 commit 1ded831

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

googletest/cmake/internal_utils.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ macro(config_compiler_and_linker)
7777
# Suppress "unreachable code" warning
7878
# http://stackoverflow.com/questions/3232669 explains the issue.
7979
set(cxx_base_flags "${cxx_base_flags} -wd4702")
80+
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
81+
set(cxx_base_flags "-Wall -Wshadow -Werror")
82+
set(cxx_exception_flags "-fexceptions")
83+
set(cxx_no_exception_flags "-fno-exceptions")
8084
elseif (CMAKE_COMPILER_IS_GNUCXX)
8185
set(cxx_base_flags "-Wall -Wshadow -Werror")
8286
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)

0 commit comments

Comments
 (0)