History

python/lib/moresetuptools.py: remove unused variables, factorize macros

Paul Brossier committed 9 years ago

Commit 4cb48d21 parent da1a83f1 file · +5 −4Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/lib/moresetuptools.py+5−4
@@ -93,7 +93,7 @@ def add_local_aubio_lib(ext): · 92 unmodified lines
9393 ext.library_dirs += [os.path.join('build', 'src')]
9494 ext.libraries += ['aubio']
9595
96−def add_local_aubio_sources(ext, usedouble = False):
96+def add_local_aubio_sources(ext):
9797 """ build aubio inside python module instead of linking against libaubio """
9898 print("Info: libaubio was not installed or built locally with waf, adding src/")
9999 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
101101 ext.sources += aubio_sources
102102
103103 def add_local_macros(ext, usedouble = False):
104+ if usedouble:
105+ ext.define_macros += [('HAVE_AUBIO_DOUBLE', 1)]
104106 # define macros (waf puts them in build/src/config.h)
105107 for define_macro in ['HAVE_STDLIB_H', 'HAVE_STDIO_H',
106108 'HAVE_MATH_H', 'HAVE_STRING_H',
@@ -193,7 +195,6 @@ class build_ext(_build_ext): · 86 unmodified lines
193195
194196 def build_extension(self, extension):
195197 if self.enable_double or 'HAVE_AUBIO_DOUBLE' in os.environ:
196− extension.define_macros += [('HAVE_AUBIO_DOUBLE', 1)]
197198 enable_double = True
198199 else:
199200 enable_double = False
@@ -204,7 +205,7 @@ class build_ext(_build_ext): · 4 unmodified lines
204205 # use local src/aubio.h
205206 if os.path.isfile(os.path.join('src', 'aubio.h')):
206207 add_local_aubio_header(extension)
207− add_local_macros(extension)
208+ add_local_macros(extension, usedouble=enable_double)
208209 # look for a local waf build
209210 if os.path.isfile(os.path.join('build','src', 'fvec.c.1.o')):
210211 add_local_aubio_lib(extension)
@@ -212,7 +213,7 @@ class build_ext(_build_ext): · 1 unmodified line
212213 # check for external dependencies
213214 add_external_deps(extension, usedouble=enable_double)
214215 # 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)
216217 # generate files python/gen/*.c, python/gen/aubio-generated.h
217218 extension.sources += generate_external(header, output_path, overwrite = False,
218219 usedouble=enable_double)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t