Эх сурвалжийг харах

Special-case Clang-only warning flags to Clang.

Josh Haberman 10 жил өмнө
parent
commit
d8814ed59e
2 өөрчлөгдсөн 4 нэмэгдсэн , 4 устгасан
  1. 4 2
      python/setup.py
  2. 0 2
      python/tox.ini

+ 4 - 2
python/setup.py

@@ -151,8 +151,10 @@ if __name__ == '__main__':
   warnings_as_errors = '--warnings_as_errors'
   if cpp_impl in sys.argv:
     sys.argv.remove(cpp_impl)
-    extra_compile_args = ['-Wno-write-strings', '-Wno-shorten-64-to-32',
-                          '-Wno-invalid-offsetof']
+    extra_compile_args = ['-Wno-write-strings', '-Wno-invalid-offsetof']
+
+    if "clang" in os.popen('$CC --version').read():
+      extra_compile_args.append('-Wno-shorten-64-to-32')
 
     if warnings_as_errors in sys.argv:
       extra_compile_args.append('-Werror')

+ 0 - 2
python/tox.ini

@@ -1,7 +1,5 @@
 [tox]
 envlist =
-    # cpp implementation on py34 is currently broken due to
-    # changes introduced by http://bugs.python.org/issue22079.
     py{26,27,33,34}-{cpp,python}
 
 [testenv]