third_party:waf: update to upstream 2.0.4 release
[samba.git] / third_party / waf / waflib / extras / local_rpath.py
1 #! /usr/bin/env python
2 # encoding: utf-8
3 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
4
5 #! /usr/bin/env python
6 # encoding: utf-8
7 # Thomas Nagy, 2011 (ita)
8
9 from waflib.TaskGen import after_method, feature
10
11 @after_method('propagate_uselib_vars')
12 @feature('cprogram', 'cshlib', 'cxxprogram', 'cxxshlib', 'fcprogram', 'fcshlib')
13 def add_rpath_stuff(self):
14         all = self.to_list(getattr(self, 'use', []))
15         while all:
16                 name = all.pop()
17                 try:
18                         tg = self.bld.get_tgen_by_name(name)
19                 except:
20                         continue
21                 self.env.append_value('RPATH', tg.link_task.outputs[0].parent.abspath())
22                 all.extend(self.to_list(getattr(tg, 'use', [])))
23