Skip to content

Commit 8bf3e8f

Browse files
author
Samuel von Baussnern
committed
fixes include paths
1 parent afafb7a commit 8bf3e8f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

setup.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
# See
140140
# https://github.com/cython/cython/wiki/PackageHierarchy
141141
#
142+
# For example: my_include_dirs = [np.get_include()]
142143
my_include_dirs = ["."]
143144

144145

@@ -162,7 +163,7 @@
162163
raise ValueError("Unknown build configuration '%s'; valid: 'optimized', 'debug'" % (build_type))
163164

164165

165-
def declare_cython_extension(extName, use_math=False, use_openmp=False):
166+
def declare_cython_extension(extName, use_math=False, use_openmp=False, include_dirs=None):
166167
"""Declare a Cython extension module for setuptools.
167168
168169
Parameters:
@@ -205,6 +206,7 @@ def declare_cython_extension(extName, use_math=False, use_openmp=False):
205206
[extPath],
206207
extra_compile_args=compile_args,
207208
extra_link_args=link_args,
209+
include_dirs=include_dirs,
208210
libraries=libraries
209211
)
210212

@@ -257,9 +259,9 @@ def declare_cython_extension(extName, use_math=False, use_openmp=False):
257259

258260
# declare Cython extension modules here
259261
#
260-
ext_module_dostuff = declare_cython_extension( "mylibrary.dostuff", use_math=False, use_openmp=False )
261-
ext_module_compute = declare_cython_extension( "mylibrary.compute", use_math=True, use_openmp=False )
262-
ext_module_helloworld = declare_cython_extension( "mylibrary.subpackage.helloworld", use_math=False, use_openmp=False )
262+
ext_module_dostuff = declare_cython_extension( "mylibrary.dostuff", use_math=False, use_openmp=False , include_dirs=my_include_dirs )
263+
ext_module_compute = declare_cython_extension( "mylibrary.compute", use_math=True, use_openmp=False , include_dirs=my_include_dirs )
264+
ext_module_helloworld = declare_cython_extension( "mylibrary.subpackage.helloworld", use_math=False, use_openmp=False , include_dirs=my_include_dirs )
263265

264266
# this is mainly to allow a manual logical ordering of the declared modules
265267
#

0 commit comments

Comments
 (0)