From 00700b72191d620402d5eb0390b5460b35c93e05 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Tue, 6 Oct 2015 14:13:09 -0700 Subject: Removed all warnings from the Python/C++ build. Also made the Travis build ensure that no warnings are present. These builds were previously spewing many warnings, which was hiding warnings for important things like accidentally using C++11-only features. Change-Id: I56caeee9db48bc78756a3e8d7c14874630627037 --- python/setup.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'python/setup.py') diff --git a/python/setup.py b/python/setup.py index cda56867..662a145a 100755 --- a/python/setup.py +++ b/python/setup.py @@ -148,17 +148,24 @@ class build_py(_build_py): if __name__ == '__main__': ext_module_list = [] cpp_impl = '--cpp_implementation' + warnings_as_errors = '--warnings_as_errors' if cpp_impl in sys.argv: sys.argv.remove(cpp_impl) + extra_compile_args = ['-Wno-write-strings'] + + if warnings_as_errors in sys.argv: + extra_compile_args.append('-Werror') + sys.argv.remove(warnings_as_errors) + # C++ implementation extension ext_module_list.append( Extension( "google.protobuf.pyext._message", glob.glob('google/protobuf/pyext/*.cc'), - define_macros=[('GOOGLE_PROTOBUF_HAS_ONEOF', '1')], include_dirs=[".", "../src"], libraries=['protobuf'], library_dirs=['../src/.libs'], + extra_compile_args=extra_compile_args, ) ) os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'cpp' -- cgit v1.2.3