From 299f1617d3490507c9f45ec8e7eb76b072f06529 Mon Sep 17 00:00:00 2001 From: Chase Geigle Date: Tue, 29 Aug 2017 23:33:21 -0500 Subject: [PATCH] fix(cmake): Suppress -Wnoexcept-type warning on GCC There is no way to avoid this error in the code itself, so we must suppress this warning if we wish to keep -Werror. --- cmake/01-core.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/01-core.cmake b/cmake/01-core.cmake index 67ed81bf..36ec8661 100644 --- a/cmake/01-core.cmake +++ b/cmake/01-core.cmake @@ -22,6 +22,11 @@ string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPER) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + # there's no way to modify the code to avoid this warning, so we must + # suppress it if we use -Werror + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-noexcept-type") +endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic-errors")