Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -93,7 +93,7 @@ def add_local_aubio_lib(ext): · 92 unmodified lines | ||
| 93 | 93 | ext.library_dirs += [os.path.join('build', 'src')] |
| 94 | 94 | ext.libraries += ['aubio'] |
| 95 | 95 | |
| 96 | −def add_local_aubio_sources(ext, usedouble = False): | |
| 96 | +def add_local_aubio_sources(ext): | |
| 97 | 97 | """ build aubio inside python module instead of linking against libaubio """ |
| 98 | 98 | print("Info: libaubio was not installed or built locally with waf, adding src/") |
| 99 | 99 | aubio_sources = sorted(glob.glob(os.path.join('src', '**.c'))) |
| @@ -101,6 +101,8 @@ def add_local_aubio_sources(ext, usedouble = False): · 1 unmodified line | ||
| 101 | 101 | ext.sources += aubio_sources |
| 102 | 102 | |
| 103 | 103 | def add_local_macros(ext, usedouble = False): |
| 104 | + if usedouble: | |
| 105 | + ext.define_macros += [('HAVE_AUBIO_DOUBLE', 1)] | |
| 104 | 106 | # define macros (waf puts them in build/src/config.h) |
| 105 | 107 | for define_macro in ['HAVE_STDLIB_H', 'HAVE_STDIO_H', |
| 106 | 108 | 'HAVE_MATH_H', 'HAVE_STRING_H', |
| @@ -193,7 +195,6 @@ class build_ext(_build_ext): · 86 unmodified lines | ||
| 193 | 195 | |
| 194 | 196 | def build_extension(self, extension): |
| 195 | 197 | if self.enable_double or 'HAVE_AUBIO_DOUBLE' in os.environ: |
| 196 | − extension.define_macros += [('HAVE_AUBIO_DOUBLE', 1)] | |
| 197 | 198 | enable_double = True |
| 198 | 199 | else: |
| 199 | 200 | enable_double = False |
| @@ -204,7 +205,7 @@ class build_ext(_build_ext): · 4 unmodified lines | ||
| 204 | 205 | # use local src/aubio.h |
| 205 | 206 | if os.path.isfile(os.path.join('src', 'aubio.h')): |
| 206 | 207 | add_local_aubio_header(extension) |
| 207 | − add_local_macros(extension) | |
| 208 | + add_local_macros(extension, usedouble=enable_double) | |
| 208 | 209 | # look for a local waf build |
| 209 | 210 | if os.path.isfile(os.path.join('build','src', 'fvec.c.1.o')): |
| 210 | 211 | add_local_aubio_lib(extension) |
| @@ -212,7 +213,7 @@ class build_ext(_build_ext): · 1 unmodified line | ||
| 212 | 213 | # check for external dependencies |
| 213 | 214 | add_external_deps(extension, usedouble=enable_double) |
| 214 | 215 | # add libaubio sources and look for optional deps with pkg-config |
| 215 | − add_local_aubio_sources(extension, usedouble=enable_double) | |
| 216 | + add_local_aubio_sources(extension) | |
| 216 | 217 | # generate files python/gen/*.c, python/gen/aubio-generated.h |
| 217 | 218 | extension.sources += generate_external(header, output_path, overwrite = False, |
| 218 | 219 | usedouble=enable_double) |