summaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-08-10 03:01:49 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-08-10 03:01:49 (GMT)
commitacb8c5234302f8057b331abaafb2cc8697daf58f (patch)
treec2fcf8f963d5c9755937799022e05e210534211f /setup.py
parent3b48af018f6a7e7d1d0ec5acefe2890361dbf832 (diff)
downloadcpython-acb8c5234302f8057b331abaafb2cc8697daf58f.zip
cpython-acb8c5234302f8057b331abaafb2cc8697daf58f.tar.gz
cpython-acb8c5234302f8057b331abaafb2cc8697daf58f.tar.bz2
add -Werror=declaration-after-statement only to stdlib extension modules (closes #21121)
Patch from Stefan Krah.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index c909261..5d4f444 100644
--- a/setup.py
+++ b/setup.py
@@ -19,6 +19,12 @@ from distutils.spawn import find_executable
cross_compiling = "_PYTHON_HOST_PLATFORM" in os.environ
+# Add special CFLAGS reserved for building the interpreter and the stdlib
+# modules (Issue #21121).
+cflags = sysconfig.get_config_var('CFLAGS')
+py_cflags_nodist = sysconfig.get_config_var('PY_CFLAGS_NODIST')
+sysconfig.get_config_vars()['CFLAGS'] = cflags + ' ' + py_cflags_nodist
+
def get_platform():
# cross build
if "_PYTHON_HOST_PLATFORM" in os.environ: