local_rpath.py 538 B

12345678910111213141516171819
  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. # Thomas Nagy, 2011 (ita)
  4. from waflib.TaskGen import after_method, feature
  5. @after_method('propagate_uselib_vars')
  6. @feature('cprogram', 'cshlib', 'cxxprogram', 'cxxshlib', 'fcprogram', 'fcshlib')
  7. def add_rpath_stuff(self):
  8. all = self.to_list(getattr(self, 'use', []))
  9. while all:
  10. name = all.pop()
  11. try:
  12. tg = self.bld.get_tgen_by_name(name)
  13. except:
  14. continue
  15. self.env.append_value('RPATH', tg.link_task.outputs[0].parent.abspath())
  16. all.extend(self.to_list(getattr(tg, 'use', [])))