mirror of https://github.com/google/snappy.git
Building with `-Werror` only with clang.
gcc was unable to inline a function call, which caused a build failure due to `-Wall -Werror`. The build error was: ``` ../snappy.cc:292:76: error: ignoring attributes on template argument ‘__m128i’ [-Werror=ignored-attributes] 292 | static inline std::pair<__m128i /* pattern */, __m128i /* reshuffle_mask */> | ^ ../snappy.cc:292:76: error: ignoring attributes on template argument ‘__m128i’ [-Werror=ignored-attributes] cc1plus: all warnings being treated as errors ```
This commit is contained in:
parent
42d1dd7ea3
commit
955a5dd1b3
|
@ -66,10 +66,13 @@ else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
|
||||
endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
|
||||
|
||||
# Use -Werror for clang and gcc.
|
||||
# Use -Werror for clang only.
|
||||
# There are many clang compiler ID's, but only one gcc.
|
||||
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GCC")
|
||||
if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
|
||||
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GCC")
|
||||
|
||||
# Disable C++ exceptions.
|
||||
string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
|
|
Loading…
Reference in New Issue