orc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject [orc] branch branch-1.5 updated: ORC-480: [C++] Add an option to succeed despite warnings
Date Wed, 23 Oct 2019 16:33:41 GMT
This is an automated email from the ASF dual-hosted git repository.

omalley pushed a commit to branch branch-1.5
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/branch-1.5 by this push:
     new 8d85c8f  ORC-480: [C++] Add an option to succeed despite warnings
8d85c8f is described below

commit 8d85c8ff4ba08f739ec58ff152cd972a62b51f79
Author: Antoine Pitrou <antoine@python.org>
AuthorDate: Wed Oct 23 11:22:13 2019 +0200

    ORC-480: [C++] Add an option to succeed despite warnings
    
    The extensive warnings that are set are useful for CI and development,
    but a nuisance for external packagers and dependent projects which
    can encounter failing builds because of warnings in ORC.
    
    Fixes #441
    
    Signed-off-by: Owen O'Malley <omalley@apache.org>
---
 CMakeLists.txt | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c3e57fa..f4c2800 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,6 +49,10 @@ option(INSTALL_VENDORED_LIBS
     "Install vendored thirdparty libraries along with liborc"
     ON)
 
+option(STOP_BUILD_ON_WARNING
+    "Fail the build on C++ warnings"
+    ON)
+
 # Make sure that a build type is selected
 if (NOT CMAKE_BUILD_TYPE)
   message(STATUS "No build type selected, default to ReleaseWithDebugInfo")
@@ -81,9 +85,18 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   set (WARN_FLAGS "${WARN_FLAGS} -Wno-covered-switch-default")
   set (WARN_FLAGS "${WARN_FLAGS} -Wno-missing-noreturn -Wno-unknown-pragmas")
   set (WARN_FLAGS "${WARN_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
-  set (WARN_FLAGS "${WARN_FLAGS} -Wconversion -Werror")
+  set (WARN_FLAGS "${WARN_FLAGS} -Wconversion")
+  if (CMAKE_HOST_APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "11.0")
+    set (WARN_FLAGS "${WARN_FLAGS} -Wno-c++2a-compat")
+  endif ()
+  if (STOP_BUILD_ON_WARNING)
+    set (WARN_FLAGS "${WARN_FLAGS} -Werror")
+  endif ()
 elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
-  set (WARN_FLAGS "-Wall -Wno-unknown-pragmas -Wconversion -Werror")
+  set (WARN_FLAGS "-Wall -Wno-unknown-pragmas -Wconversion")
+  if (STOP_BUILD_ON_WARNING)
+    set (WARN_FLAGS "${WARN_FLAGS} -Werror")
+  endif ()
   if (CMAKE_CXX_COMPILER_VERSION STREQUAL "" OR
       CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7")
     set (CXX11_FLAGS "-std=c++0x")


Mime
View raw message