Changeset a89ed31 for python/lib


Ignore:
Timestamp:
Apr 25, 2016, 11:33:11 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
c31b589
Parents:
07867cd
Message:

python/setup.py: add command 'generate' with option '--enable-double'

Location:
python/lib
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • python/lib/gen_external.py

    r07867cd ra89ed31  
    1 import os
     1import os, glob
    22
    33header = """// this file is generated! do not modify
     
    6767    return cpp_output, cpp_objects
    6868
    69 def generate_external(output_path, usedouble = False):
     69def generate_external(output_path, usedouble = False, overwrite = True):
    7070    if not os.path.isdir(output_path): os.mkdir(output_path)
     71    elif overwrite == False: return glob.glob(os.path.join(output_path, '*.c'))
    7172    sources_list = []
    7273    cpp_output, cpp_objects = get_cpp_objects()
     
    161162
    162163    objlist = "".join(["extern PyTypeObject Py_%sType;\n" % p for p in lib])
    163     out = """
    164 // generated list of objects created with gen_external.py
     164    out = """// generated list of objects created with gen_external.py
     165
    165166#include <Python.h>
    166 
     167"""
     168    if usedouble:
     169        out += """
     170#ifndef HAVE_AUBIO_DOUBLE
     171#define HAVE_AUBIO_DOUBLE 1
     172#endif
     173"""
     174    out += """
    167175{objlist}
    168176int generated_objects ( void );
Note: See TracChangeset for help on using the changeset viewer.