From 697cad702719b80e16fd10aef418eaec80b424b9 Mon Sep 17 00:00:00 2001 From: maurice barnum Date: Thu, 11 Feb 2016 00:03:53 +0000 Subject: [PATCH] fix gcc-4.4 build: -Werror=unused-result is not supported --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 511860802..e8449caa8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,7 +81,11 @@ if(APPLE) "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wall -pedantic -Werror -Wextra") elseif(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic -Werror -Wextra -Werror=shadow -Wunused-result -Werror=unused-result") + "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic -Werror -Wextra -Werror=shadow") + if (GCC_VERSION VERSION_GREATER 4.4) + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -Wunused-result -Werror=unused-result") + endif() elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -stdlib=libc++ -Wall -pedantic -Werror -Wextra")