From 29c1089983ce678430a1c120a38b1a183aebcbbd Mon Sep 17 00:00:00 2001 From: Serge Gautherie Date: Sat, 17 Aug 2019 01:14:36 +0200 Subject: [PATCH] [CMAKE] gcc.cmake: '-Wno-unused-const-variable' applies to GCC 6.1+ GCC 4.7.2 logs 'cc1: error: unrecognized command line option "-Wno-unused-const-variable" [-Werror]' Addendum to 8eb7a1a2f4a9cce5a70a9c48efb30cdfa59bf56f. --- sdk/cmake/gcc.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/cmake/gcc.cmake b/sdk/cmake/gcc.cmake index d91a9483e83..d37d1c06553 100644 --- a/sdk/cmake/gcc.cmake +++ b/sdk/cmake/gcc.cmake @@ -113,7 +113,9 @@ endif() add_compile_flags("-Wall -Wpointer-arith") add_compile_flags("-Wno-char-subscripts -Wno-multichar -Wno-unused-value") -add_compile_flags("-Wno-unused-const-variable") +if(NOT GCC_VERSION VERSION_LESS 6.1) + add_compile_flags("-Wno-unused-const-variable") +endif() add_compile_flags("-Wno-unused-local-typedefs") add_compile_flags("-Wno-deprecated")