diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-08-05 12:53:27 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-08-05 12:57:34 +0200 |
commit | 8af0d9fec81cb0f19fa8bf6c409d94ea246eb5d1 (patch) | |
tree | 441a4324dae61ee571203f1de8ecf73ab2fca507 /waftools | |
parent | b34621e1b13c82659d00f3d3e032f590eeb95faf (diff) |
build: syms: reindent
We avoided reindenting this in the past to allow merging upstream changes.
In hindsight these are very unlikely and we are actually doing changes on
the code, so it's better to have the correct indentation and formatting in
our source file.
Diffstat (limited to 'waftools')
-rw-r--r-- | waftools/syms.py | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/waftools/syms.py b/waftools/syms.py index e8a37c1a11..eff35e75a3 100644 --- a/waftools/syms.py +++ b/waftools/syms.py @@ -18,36 +18,35 @@ from waflib.Errors import WafError from waflib.TaskGen import feature, after_method class compile_sym(Task): - def run(self): - lsyms = [] - for line in self.inputs[0].read().split(): - lsyms.append(line.strip()) - lsyms.sort() - if self.env.DEST_BINFMT == 'pe': - self.outputs[0].write('EXPORTS\n' + '\n'.join(lsyms)) - elif self.env.DEST_BINFMT == 'elf': - self.outputs[0].write('{ global:\n' + ';\n'.join(lsyms) + ";\nlocal: *; };\n") - elif self.env.DEST_BINFMT == 'mac-o': - self.outputs[0].write('\n'.join("_"+sym for sym in lsyms) + '\n') - else: - raise WafError('NotImplemented') - -@feature('syms') -@after_method('process_source', 'process_use', 'apply_link', 'process_uselib_local') -def do_the_symbol_stuff(self): - tsk = self.create_task('compile_sym', - [self.path.find_node(self.export_symbols_def)], - self.path.find_or_declare(getattr(self, 'sym_filename', self.target + '.def'))) - self.link_task.set_run_after(tsk) - self.link_task.dep_nodes.append(tsk.outputs[0]) - if 'msvc' in (self.env.CC_NAME, self.env.CXX_NAME): - self.link_task.env.append_value('LINKFLAGS', ['/def:' + tsk.outputs[0].bldpath()]) - elif self.env.DEST_BINFMT == 'pe': #gcc on windows takes *.def as an additional input - self.link_task.inputs.append(tsk.outputs[0]) + def run(self): + lsyms = [] + for line in self.inputs[0].read().split(): + lsyms.append(line.strip()) + lsyms.sort() + if self.env.DEST_BINFMT == 'pe': + self.outputs[0].write('EXPORTS\n' + '\n'.join(lsyms)) elif self.env.DEST_BINFMT == 'elf': - self.link_task.env.append_value('LINKFLAGS', ['-Wl,-version-script', '-Wl,' + tsk.outputs[0].bldpath()]) + self.outputs[0].write('{ global:\n' + ';\n'.join(lsyms) + ";\nlocal: *; };\n") elif self.env.DEST_BINFMT == 'mac-o': - self.link_task.env.append_value('LINKFLAGS', ['-exported_symbols_list', tsk.outputs[0].bldpath()]) + self.outputs[0].write('\n'.join("_"+sym for sym in lsyms) + '\n') else: - raise WafError('NotImplemented') + raise WafError('NotImplemented') +@feature('syms') +@after_method('process_source', 'process_use', 'apply_link', 'process_uselib_local') +def do_the_symbol_stuff(self): + tsk = self.create_task('compile_sym', + [self.path.find_node(self.export_symbols_def)], + self.path.find_or_declare(getattr(self, 'sym_filename', self.target + '.def'))) + self.link_task.set_run_after(tsk) + self.link_task.dep_nodes.append(tsk.outputs[0]) + if 'msvc' in (self.env.CC_NAME, self.env.CXX_NAME): + self.link_task.env.append_value('LINKFLAGS', ['/def:' + tsk.outputs[0].bldpath()]) + elif self.env.DEST_BINFMT == 'pe': #gcc on windows takes *.def as an additional input + self.link_task.inputs.append(tsk.outputs[0]) + elif self.env.DEST_BINFMT == 'elf': + self.link_task.env.append_value('LINKFLAGS', ['-Wl,-version-script', '-Wl,' + tsk.outputs[0].bldpath()]) + elif self.env.DEST_BINFMT == 'mac-o': + self.link_task.env.append_value('LINKFLAGS', ['-exported_symbols_list', tsk.outputs[0].bldpath()]) + else: + raise WafError('NotImplemented') |