|
139 | 139 | # See |
140 | 140 | # https://github.com/cython/cython/wiki/PackageHierarchy |
141 | 141 | # |
| 142 | +# For example: my_include_dirs = [np.get_include()] |
142 | 143 | my_include_dirs = ["."] |
143 | 144 |
|
144 | 145 |
|
|
162 | 163 | raise ValueError("Unknown build configuration '%s'; valid: 'optimized', 'debug'" % (build_type)) |
163 | 164 |
|
164 | 165 |
|
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): |
166 | 167 | """Declare a Cython extension module for setuptools. |
167 | 168 |
|
168 | 169 | Parameters: |
@@ -205,6 +206,7 @@ def declare_cython_extension(extName, use_math=False, use_openmp=False): |
205 | 206 | [extPath], |
206 | 207 | extra_compile_args=compile_args, |
207 | 208 | extra_link_args=link_args, |
| 209 | + include_dirs=include_dirs, |
208 | 210 | libraries=libraries |
209 | 211 | ) |
210 | 212 |
|
@@ -257,9 +259,9 @@ def declare_cython_extension(extName, use_math=False, use_openmp=False): |
257 | 259 |
|
258 | 260 | # declare Cython extension modules here |
259 | 261 | # |
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 ) |
263 | 265 |
|
264 | 266 | # this is mainly to allow a manual logical ordering of the declared modules |
265 | 267 | # |
|
0 commit comments