CMake: Enable -Werror for the -fno-function-sections check

If the -fno-function-sections flag isn't recognized, the compiler
emits a warning. This isn't enough to cause the check to fail, so we
enable -Werror as well.

llvm-svn: 200753
This commit is contained in:
Justin Bogner 2014-02-04 10:40:46 +00:00
parent e42fb07618
commit ad560c4c11
1 changed files with 1 additions and 1 deletions

View File

@ -164,7 +164,7 @@ if (NOT MSVC)
endif()
endif()
# Build sanitizer runtimes with -fno-function-sections.
check_cxx_compiler_flag(-fno-function-sections SUPPORTS_FNO_FUNCTION_SECTIONS_FLAG)
check_cxx_compiler_flag(-Werror -fno-function-sections SUPPORTS_FNO_FUNCTION_SECTIONS_FLAG)
if(SUPPORTS_FNO_FUNCTION_SECTIONS_FLAG)
list(APPEND SANITIZER_COMMON_CFLAGS -fno-function-sections)
endif()