From a07674be4d532c53eb64c574cc2723baea098f8e Mon Sep 17 00:00:00 2001 From: Robert Schulze Date: Tue, 10 May 2022 22:24:45 +0200 Subject: [PATCH] Move WERROR option closer to its usage --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0fc1cbc240..b0226e567b9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -422,13 +422,6 @@ endif () # Turns on all external libs like s3, kafka, ODBC, ... option(ENABLE_LIBRARIES "Enable all external libraries by default" ON) -if (NOT (OS_LINUX OR OS_DARWIN)) - # Using system libs can cause a lot of warnings in includes (on macro expansion). - option(WERROR "Enable -Werror compiler option" OFF) -else () - option(WERROR "Enable -Werror compiler option" ON) -endif () - # Increase stack size on Musl. We need big stack for our recursive-descend parser. if (USE_MUSL) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,stack-size=2097152") @@ -446,6 +439,13 @@ elseif (OS_FREEBSD) endif () link_libraries(global-group) +if (NOT (OS_LINUX OR OS_DARWIN)) + # Using system libs can cause a lot of warnings in includes (on macro expansion). + option(WERROR "Enable -Werror compiler option" OFF) +else () + option(WERROR "Enable -Werror compiler option" ON) +endif () + if (WERROR) # Don't pollute CMAKE_CXX_FLAGS with -Werror as it will break some CMake checks. # Instead, adopt modern cmake usage requirement.