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