From 6c0f4cc082c5db3619e98df5c26857bca74e7129 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Thu, 28 Jul 2016 00:19:24 +0100 Subject: [PATCH] Fix reoccurrence of py bindings -Wstrict-prototype warning (#959) * Recent commit df368c2d158 has allowed the -Wstrict-prototype flag to once again be passed to gcc so this fix removes all occurrences not just from 'OPT'. --- bindings/python/setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 86f43ea83..13b25e84a 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from distutils.core import setup, Extension -from distutils.sysconfig import get_config_var +from distutils.sysconfig import get_config_vars import os import platform import sys @@ -102,8 +102,10 @@ if '--bjam' in sys.argv: else: # Remove the '-Wstrict-prototypes' compiler option, which isn't valid for C++. - os.environ['OPT'] = ' '.join( - flag for flag in get_config_var('OPT').split() if flag != '-Wstrict-prototypes') + cfg_vars = get_config_vars() + for key, value in cfg_vars.items(): + if isinstance(value, str): + cfg_vars[key] = value.replace('-Wstrict-prototypes', '') source_list = os.listdir(os.path.join(os.path.dirname(__file__), "src")) source_list = [os.path.abspath(os.path.join(os.path.dirname(__file__), "src", s)) for s in source_list if s.endswith(".cpp")]