Only enable Clang-specific errors on Clang.

-W[error=]unused-lambda-capture is not recognized by GCC.

Change-Id: I6d1bfc470c4afc0e72b76d2a26efb85eb8d8c8fb
Reviewed-on: https://swiftshader-review.googlesource.com/c/22368
Reviewed-by: Takuto Ikuta <tikuta@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Takuto Ikuta <tikuta@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1675cf9..12ebdd9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -203,9 +203,12 @@
     set_cpp_flag("-Werror=reorder")
     set_cpp_flag("-Werror=sign-compare")
     set_cpp_flag("-Werror=missing-braces")
-    set_cpp_flag("-Werror=unused-lambda-capture")
     set_cpp_flag("-fno-exceptions")
 
+    if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+        set_cpp_flag("-Werror=unused-lambda-capture")
+    endif()
+
     # Remove xor, and, or and friends from the list of keywords, they are used
     # by Reactor
     set_cpp_flag("-fno-operator-names")