Skip to content

Commit b3d4aaf

Browse files
committed
Cython: ignoring warnings
1 parent e2a9344 commit b3d4aaf

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ def get_compiler_flags():
3838
return cflags
3939

4040

41+
CFLAGS_CPP = get_compiler_flags()
42+
43+
4144
def compile_cython_extensions():
4245
"""Compile Cython extensions"""
4346
for fname in os.listdir(SRCPATH):
@@ -55,7 +58,9 @@ def compile_cython_extensions():
5558
# In the meantime, we should not be worried about the deprecation warnings when
5659
# building the package.
5760
DEFINE_MACROS_CYTHON = []
61+
CFLAGS_CYTHON = ["-Wno-cpp"]
5862
# DEFINE_MACROS_CYTHON = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
63+
# CFLAGS_CYTHON = []
5964
# -------------------------------------------------------------------------------------
6065

6166
DEFINE_MACROS_CPP = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
@@ -66,24 +71,27 @@ def compile_cython_extensions():
6671
name=f"{LIBNAME}.mandelbrot",
6772
sources=[osp.join(SRCPATH, "mandelbrot.c")],
6873
include_dirs=INCLUDE_DIRS,
74+
extra_compile_args=CFLAGS_CYTHON,
6975
define_macros=DEFINE_MACROS_CYTHON,
7076
),
7177
Extension(
7278
name=f"{LIBNAME}.histogram2d",
7379
sources=[osp.join(SRCPATH, "histogram2d.c")],
7480
include_dirs=INCLUDE_DIRS,
81+
extra_compile_args=CFLAGS_CYTHON,
7582
define_macros=DEFINE_MACROS_CYTHON,
7683
),
7784
Extension(
7885
name=f"{LIBNAME}.contour2d",
7986
sources=[osp.join(SRCPATH, "contour2d.c")],
8087
include_dirs=INCLUDE_DIRS,
88+
extra_compile_args=CFLAGS_CYTHON,
8189
define_macros=DEFINE_MACROS_CYTHON,
8290
),
8391
Extension(
8492
name=f"{LIBNAME}._scaler",
8593
sources=[osp.join(SRCPATH, "scaler.cpp"), osp.join(SRCPATH, "pcolor.cpp")],
86-
extra_compile_args=get_compiler_flags(),
94+
extra_compile_args=CFLAGS_CPP,
8795
depends=[
8896
osp.join(SRCPATH, "traits.hpp"),
8997
osp.join(SRCPATH, "points.hpp"),

0 commit comments

Comments
 (0)