You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by om...@apache.org on 2019/10/23 14:10:36 UTC
[orc] branch master updated: ORC-480: [C++] Add an option to
succeed despite warnings
This is an automated email from the ASF dual-hosted git repository.
omalley pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/orc.git
The following commit(s) were added to refs/heads/master by this push:
new b7fd75c ORC-480: [C++] Add an option to succeed despite warnings
b7fd75c is described below
commit b7fd75ce616cb0a6368fb48b61eccb6685254e64
Author: Antoine Pitrou <an...@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 <om...@apache.org>
---
CMakeLists.txt | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7e287dc..0e67b2d 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")
@@ -85,9 +89,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if (CMAKE_HOST_APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "11.0")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-c++2a-compat")
endif ()
- set (WARN_FLAGS "${WARN_FLAGS} -Werror")
+ 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")