Changeset 8774047


Ignore:
Timestamp:
Oct 3, 2017, 3:27:37 PM (6 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
Children:
b3cbe94
Parents:
f2f9d8b
Message:

src/wscript_build: on windows, use 'link /dump /symbols' to generate list of symbols

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/wscript_build

    rf2f9d8b r8774047  
    5252        syms = {}
    5353        reg = getattr(self.generator, 'export_symbols_regex','.+?')
    54         binary_path = self.generator.link_task.outputs[0].abspath()
    5554        if 'msvc' in self.env.CC_NAME:
    56             reg_compiled = re.compile(r'External\s+\|\s+_(?P<symbol>%s)\b' % reg)
    57             cmd =(self.env.DUMPBIN or['dumpbin'])+['/symbols', binary_path]
     55            outputs = [x.abspath() for x in self.generator.link_task.outputs]
     56            binary_path = list(filter(lambda x: x.endswith('lib'), outputs))[0]
     57            reg_compiled = re.compile(r'External\s+\|\s+(?P<symbol>%s)\b' % reg)
     58            cmd =(self.env.LINK_CC) + ['/dump', '/symbols', binary_path]
    5859        else: # using gcc? assume we have nm
     60            binary_path = self.generator.link_task.outputs[0].abspath()
    5961            reg_compiled = re.compile(r'(T|D)\s+_(?P<symbol>%s)\b'%reg)
    6062            cmd = (self.env.NM or ['nm']) + ['-g', binary_path]
    61         print (cmd)
    6263        dump_output = self.generator.bld.cmd_and_log(cmd, quiet=STDOUT)
    63         print (dump_output)
    64         syms = []
     64        syms = set([])
    6565        for m in reg_compiled.finditer(dump_output):
    66             syms += [m.group('symbol')]
    67             print (m.group('symbol'))
     66            syms.add(m.group('symbol'))
     67        syms = list(syms)
     68        syms.sort()
    6869        self.outputs[0].write('EXPORTS\n'+'\n'.join(syms))
    6970
     
    8283            use = uselib + ['lib_objects'],
    8384            target = 'aubio',
    84             export_symbols_regex=r'(?:.*aubio|fvec|lvec|cvec|fmat)_.*',
     85            export_symbols_regex=r'(?:.*aubio|fvec|lvec|cvec|fmat|new|del)_.*',
    8586            vnum = ctx.env['LIB_VERSION'])
    8687
Note: See TracChangeset for help on using the changeset viewer.