From 39bdabcd29ac41927686137b7ae9b00d5f1ad8db Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Fri, 1 Oct 2021 05:09:04 -0700 Subject: [PATCH] Don't add these warnings on GCC. --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd4145c88..f5a0fd649 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,8 +42,11 @@ endif() # Enable a whole bunch of warnings, but turn off: # - comment because we use a bunch of those, and they're not really all that harmful. # - address, because that occurs for our mkostemp check (weak-linking requires us to compare `&mkostemp == nullptr`). -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-comment -Wno-address -Wunused-template \ - -Wunused-function -Wunused-local-typedef -Wunused-lambda-capture -Wunused-macros -Wunused-variable") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-comment -Wno-address") + +if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-template -Wunused-local-typedef -Wunused-macros") +endif() # Disable exception handling. add_compile_options(-fno-exceptions)