summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorChristoph Reiter <reiter.christoph@gmail.com>2018-03-21 08:37:01 +0100
committerChristoph Reiter <reiter.christoph@gmail.com>2018-03-21 09:20:21 +0100
commite10d698329529e5e612932567d0bf0ae1acb5674 (patch)
treebb7ea32ed5d6118824a25a4d8d86002e0d5f26ba /setup.py
parent88e2ef3448397ab406e8278a53ce6297972a6fa0 (diff)
downloadpygobject-e10d698329529e5e612932567d0bf0ae1acb5674.tar.gz
setup.py: support building with PyPy. See #180
Force the extension for the test libraries, PyPy adds its abi tag by default. Make sure -fno-strict-aliasing is used, PyPy doesn't by default. Set -Wno-redundant-decls to prevent warning noise from PyPy headers.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index e44377f8..e7edfe6d 100755
--- a/setup.py
+++ b/setup.py
@@ -24,6 +24,7 @@ import errno
import subprocess
import tarfile
import sysconfig
+import platform
from email import parser
import pkg_resources
@@ -329,13 +330,14 @@ class build_tests(Command):
if os.name == "nt":
compiler.shared_lib_extension = ".dll"
-
- if sys.platform == "darwin":
+ elif sys.platform == "darwin":
compiler.shared_lib_extension = ".dylib"
if "-bundle" in compiler.linker_so:
compiler.linker_so = list(compiler.linker_so)
i = compiler.linker_so.index("-bundle")
compiler.linker_so[i] = "-dynamiclib"
+ else:
+ compiler.shared_lib_extension = ".so"
def build_ext(ext):
if compiler.compiler_type == "msvc":
@@ -773,6 +775,13 @@ def add_ext_warn_flags(ext, compiler, _cache={}):
"-Wno-unused-command-line-argument",
]
+ args += [
+ "-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]