From 825d344daa31be19cc62d86b0c7f6ff308c1d0ab Mon Sep 17 00:00:00 2001 From: Nicolas Capens Date: Tue, 6 Nov 2018 23:50:05 -0500 Subject: [PATCH] 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 Reviewed-by: Nicolas Capens Tested-by: Takuto Ikuta --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1675cf992..12ebdd9ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,9 +203,12 @@ else() 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") -- 2.11.0