From 4f9e4f9b5e91e421cc7fe603ad7eb128cdb48f65 Mon Sep 17 00:00:00 2001 From: TheHolyRoger Date: Fri, 26 Mar 2021 03:59:04 +0000 Subject: [PATCH] Fix / Disable `-Wstrict-prototypes` warning during build --- setup.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup.py b/setup.py index 083859ad4c..d8f3934d02 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ #!/usr/bin/env python from setuptools import setup +from setuptools.command.build_ext import build_ext from Cython.Build import cythonize import numpy as np import os @@ -17,6 +18,16 @@ os.environ["CFLAGS"] = "-std=c++11" +# Avoid a gcc warning below: +# cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid +# for C/ObjC but not for C++ +class BuildExt(build_ext): + def build_extensions(self): + if '-Wstrict-prototypes' in self.compiler.compiler_so: + self.compiler.compiler_so.remove('-Wstrict-prototypes') + super().build_extensions() + + def main(): cpu_count = os.cpu_count() or 8 version = "20210309" @@ -165,6 +176,7 @@ def main(): "bin/hummingbot.py", "bin/hummingbot_quickstart.py" ], + cmdclass={'build_ext': BuildExt}, )