From 05cc23f28e9be2f6f34598c23e0d214d96325fa8 Mon Sep 17 00:00:00 2001 From: JackyWoo Date: Mon, 28 Oct 2024 09:53:24 -0700 Subject: [PATCH] Add CMake option for 'ENABLE_ALL_WARNINGS' to match Makefile. (#11218) Summary: Fixes https://github.com/facebookincubator/velox/issues/11217 ### Changelog 1. Add CMake option 'ENABLE_ALL_WARNINGS' to align pure CMake execution with Makefile Pull Request resolved: https://github.com/facebookincubator/velox/pull/11218 Reviewed By: xiaoxmeng Differential Revision: D64696632 Pulled By: kgpai fbshipit-source-id: 7292c656e512dfe5d70d99acca7a505ee4b00958 --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 064e78eab273..97ba92170c0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,7 @@ option( This will override other build options." OFF) option(VELOX_MONO_LIBRARY "Build single unified library." OFF) +option(ENABLE_ALL_WARNINGS "Enable -Wall and -Wextra compiler warnings." ON) # option() always creates a BOOL variable so we have to use a normal cache # variable with STRING type for this option. @@ -335,7 +336,7 @@ if("${MAX_LINK_JOBS}") set(CMAKE_JOB_POOL_LINK link_job_pool) endif() -if("${ENABLE_ALL_WARNINGS}") +if(ENABLE_ALL_WARNINGS) if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(KNOWN_COMPILER_SPECIFIC_WARNINGS "-Wno-range-loop-analysis \