aboutsummaryrefslogtreecommitdiffhomepage
path: root/python/setup.py
diff options
context:
space:
mode:
authorGravatar Josh Haberman <jhaberman@gmail.com>2015-10-06 14:13:09 -0700
committerGravatar Josh Haberman <jhaberman@gmail.com>2015-10-28 17:05:47 -0700
commit00700b72191d620402d5eb0390b5460b35c93e05 (patch)
treedbf199b487dadb402ae52c401ab95c81f437a9ef /python/setup.py
parent12fb61b292d7ec4cb14b0d60e58ed5c35adda3b7 (diff)
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
Diffstat (limited to 'python/setup.py')
-rwxr-xr-xpython/setup.py9
1 files changed, 8 insertions, 1 deletions
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'