From d0f697be64d875997b7561a665490610afc4b130 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Fri, 1 Oct 2021 04:36:14 -0700 Subject: [PATCH] Update CMakeLists.txt Revert the change getting rid of the -UNDEBUG, add some unused-blah warnings. We are often using the system assert() because we include other headers that include assert.h. I noticed that assert() was being compiled out because I started getting new warnings printed about unusued variables (that were only used in the assert()s. Add these warnings to the build. --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5eeea4db5..cd4145c88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,14 +42,15 @@ 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 \ -") +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") # Disable exception handling. add_compile_options(-fno-exceptions) +# Undefine NDEBUG to keep assert() in release builds. +add_definitions(-UNDEBUG) + # Hide the CMake Rules directories in Xcode projects. source_group("CMake Rules" REGULAR_EXPRESSION "^$")