You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.5KB

  1. #!/bin/env python
  2. import os
  3. from distutils.core import setup, Extension
  4. if hasattr(os, 'uname'):
  5. OSNAME = os.uname()[0]
  6. else:
  7. OSNAME = 'Windows'
  8. define_macros = []
  9. libraries = []
  10. extra_link_args = []
  11. extra_compile_args = ['-I../../../']
  12. sources = ['rtaudiomodule.cpp', '../../../RtAudio.cpp']
  13. if OSNAME == 'Linux':
  14. define_macros=[("__LINUX_ALSA__", ''),
  15. ('__LINUX_JACK__', '')]
  16. libraries = ['asound', 'jack', 'pthread']
  17. elif OSNAME == 'Darwin':
  18. define_macros = [('__MACOSX_CORE__', '')]
  19. libraries = ['pthread', 'stdc++']
  20. extra_link_args = ['-framework', 'CoreAudio']
  21. elif OSNAME == 'Windows':
  22. define_macros = [('__WINDOWS_DS__', None),
  23. ('__WINDOWS_ASIO__', None),
  24. ('__LITTLE_ENDIAN__',None),
  25. ('WIN32',None)]
  26. libraries = ['winmm', 'dsound', 'Advapi32','Ole32','User32']
  27. sources += ['../../../include/asio.cpp',
  28. '../../../include/asiodrivers.cpp',
  29. '../../../include/asiolist.cpp',
  30. '../../../include/iasiothiscallresolver.cpp']
  31. extra_compile_args.append('-I../../../include/')
  32. extra_compile_args.append('-EHsc')
  33. audio = Extension('rtaudio',
  34. sources=sources,
  35. libraries=libraries,
  36. define_macros=define_macros,
  37. extra_compile_args = extra_compile_args,
  38. extra_link_args = extra_link_args,
  39. )
  40. setup(name = 'rtaudio',
  41. version = '0.1',
  42. description = 'Python RtAudio interface',
  43. ext_modules = [audio])