Skip to content

Commit

Permalink
Cython: ignoring warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Oct 7, 2023
1 parent e2a9344 commit b3d4aaf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def get_compiler_flags():
return cflags


CFLAGS_CPP = get_compiler_flags()


def compile_cython_extensions():
"""Compile Cython extensions"""
for fname in os.listdir(SRCPATH):
Expand All @@ -55,7 +58,9 @@ def compile_cython_extensions():
# In the meantime, we should not be worried about the deprecation warnings when
# building the package.
DEFINE_MACROS_CYTHON = []
CFLAGS_CYTHON = ["-Wno-cpp"]
# DEFINE_MACROS_CYTHON = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
# CFLAGS_CYTHON = []
# -------------------------------------------------------------------------------------

DEFINE_MACROS_CPP = [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
Expand All @@ -66,24 +71,27 @@ def compile_cython_extensions():
name=f"{LIBNAME}.mandelbrot",
sources=[osp.join(SRCPATH, "mandelbrot.c")],
include_dirs=INCLUDE_DIRS,
extra_compile_args=CFLAGS_CYTHON,
define_macros=DEFINE_MACROS_CYTHON,
),
Extension(
name=f"{LIBNAME}.histogram2d",
sources=[osp.join(SRCPATH, "histogram2d.c")],
include_dirs=INCLUDE_DIRS,
extra_compile_args=CFLAGS_CYTHON,
define_macros=DEFINE_MACROS_CYTHON,
),
Extension(
name=f"{LIBNAME}.contour2d",
sources=[osp.join(SRCPATH, "contour2d.c")],
include_dirs=INCLUDE_DIRS,
extra_compile_args=CFLAGS_CYTHON,
define_macros=DEFINE_MACROS_CYTHON,
),
Extension(
name=f"{LIBNAME}._scaler",
sources=[osp.join(SRCPATH, "scaler.cpp"), osp.join(SRCPATH, "pcolor.cpp")],
extra_compile_args=get_compiler_flags(),
extra_compile_args=CFLAGS_CPP,
depends=[
osp.join(SRCPATH, "traits.hpp"),
osp.join(SRCPATH, "points.hpp"),
Expand Down

0 comments on commit b3d4aaf

Please sign in to comment.