File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import numpy
66from setuptools import Extension , find_packages , setup
77from setuptools .command .build_ext import build_ext
8+ from Cython .Build import cythonize
89
910libraries = ['bladeRF' ]
1011
5152 environ ['CFLAGS' ] = f'{ cflags } { new_cflags } ' .strip ()
5253 environ ['LDFLAGS' ] = f'{ ldflags } { new_ldflags } ' .strip ()
5354
54- else :
55- LIBHACKRF_FILES = ['python_bladerf/pylibbladerf/pybladerf_android.pyx' , 'python_bladerf/pylibbladerf/cbladerf_android.pxd' ]
5655
56+ class CustomBuildExt (build_ext ):
57+ def run (self ):
58+ compile_env = {'ANDROID' : PLATFORM == 'android' }
59+ self .distribution .ext_modules = cythonize (
60+ self .distribution .ext_modules ,
61+ compile_time_env = compile_env ,
62+ )
63+ super ().run ()
5764
5865setup (
5966 name = 'python_bladerf' ,
60- cmdclass = {'build_ext' : build_ext },
67+ cmdclass = {'build_ext' : CustomBuildExt },
6168 install_requires = INSTALL_REQUIRES ,
6269 setup_requires = SETUP_REQUIRES ,
6370 ext_modules = [
You can’t perform that action at this time.
0 commit comments