From 337e2183cd38794d300d91e27b1fd09ac4927448 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 20 Jun 2022 04:55:28 -0500 Subject: [PATCH] fix build on GCC < 8 --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7c076a2..3d064ac0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -584,7 +584,11 @@ endif() if (NOT MSVC) set(WARNING_FLAGS -Wall -Wextra -Wno-unused-parameter) if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - list(APPEND WARNING_FLAGS -Wno-cast-function-type) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0.0) + # nothing + else() + list(APPEND WARNING_FLAGS -Wno-cast-function-type) + endif() endif() if (WARNINGS_ARE_ERRORS) list(APPEND WARNING_FLAGS -Werror)