Suppress Clang warning for unsupported warning. Clang doesn't support the unused-lambda-capture warning until version 5.0: http://releases.llvm.org/5.0.0/tools/clang/docs/DiagnosticsReference.html#wunused-lambda-capture Bug b/123933266 Change-Id: I6c5681a64e08ab479d726679ec18447dec926630 Reviewed-on: https://swiftshader-review.googlesource.com/c/24448 Tested-by: Nicolas Capens <nicolascapens@google.com> Reviewed-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Chris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt index 054ad5b..7da2b52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -205,7 +205,8 @@ set_cpp_flag("-Werror=missing-braces") set_cpp_flag("-fno-exceptions") - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND + CLANG_VERSION_STRING VERSION_GREATER_EQUAL 5) set_cpp_flag("-Werror=unused-lambda-capture") endif()