summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-03-23 07:07:26 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-03-23 07:07:26 +0100
commitb39e17e9d22659a9538ffeb14b2a6e8a6397887f (patch)
treed82a7cca061210d6a9cc70c754f4632fb6946e2f /setup.py
parentd394ad1f3a5d008a358d408af29dbb047375d93c (diff)
downloadpygobject-b39e17e9d22659a9538ffeb14b2a6e8a6397887f.tar.gz
setup.py: always define PY_SSIZE_T_CLEAN. Fixes #185
Including the Python headers with it results in a lot of -Wredundant-decls, so disable that warning.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index ce257e14..249d9e6d 100755
--- a/setup.py
+++ b/setup.py
@@ -24,7 +24,6 @@ import errno
import subprocess
import tarfile
import sysconfig
-import platform
from email import parser
import pkg_resources
@@ -484,6 +483,7 @@ class build_tests(Command):
os.path.join(tests_dir, "test-unknown.h"),
os.path.join(tests_dir, "test-floating.h"),
],
+ define_macros=[("PY_SSIZE_T_CLEAN", None)],
)
add_ext_pkg_config_dep(ext, compiler.compiler_type, "glib-2.0")
add_ext_pkg_config_dep(ext, compiler.compiler_type, "gio-2.0")
@@ -750,7 +750,6 @@ def add_ext_warn_flags(ext, compiler, _cache={}):
"-Wold-style-definition",
"-Wpacked",
"-Wpointer-arith",
- "-Wredundant-decls",
"-Wrestrict",
"-Wreturn-type",
"-Wshadow",
@@ -779,9 +778,6 @@ def add_ext_warn_flags(ext, compiler, _cache={}):
"-fno-strict-aliasing",
]
- if platform.python_implementation() == "PyPy":
- args.append("-Wno-redundant-decls")
-
_cache[cache_key] = filter_compiler_arguments(compiler, args)
ext.extra_compile_args += _cache[cache_key]
@@ -951,12 +947,14 @@ def main():
name='gi._gi',
sources=sources,
include_dirs=[script_dir, gi_dir],
+ define_macros=[("PY_SSIZE_T_CLEAN", None)],
)
gi_cairo_ext = Extension(
name='gi._gi_cairo',
sources=cairo_sources,
include_dirs=[script_dir, gi_dir],
+ define_macros=[("PY_SSIZE_T_CLEAN", None)],
)
setup(