summaryrefslogtreecommitdiffstats
path: root/extras/local_rpath.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-09-15 18:29:55 +0200
committerDavid Robillard <d@drobilla.net>2018-09-15 18:29:55 +0200
commit394c6862c3d82833fa87eb9689c3bc99d978b93b (patch)
treeff0760d5f3f0e994413c8c1dff7a4fed37914bee /extras/local_rpath.py
downloadganv-394c6862c3d82833fa87eb9689c3bc99d978b93b.tar.gz
ganv-394c6862c3d82833fa87eb9689c3bc99d978b93b.tar.bz2
ganv-394c6862c3d82833fa87eb9689c3bc99d978b93b.zip
Squashed 'waflib/' content from commit 982416b
git-subtree-dir: waflib git-subtree-split: 982416b8a6c6728e200243e1be3ab60435c08830
Diffstat (limited to 'extras/local_rpath.py')
-rw-r--r--extras/local_rpath.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/extras/local_rpath.py b/extras/local_rpath.py
new file mode 100644
index 0000000..b2507e1
--- /dev/null
+++ b/extras/local_rpath.py
@@ -0,0 +1,19 @@
+#! /usr/bin/env python
+# encoding: utf-8
+# Thomas Nagy, 2011 (ita)
+
+from waflib.TaskGen import after_method, feature
+
+@after_method('propagate_uselib_vars')
+@feature('cprogram', 'cshlib', 'cxxprogram', 'cxxshlib', 'fcprogram', 'fcshlib')
+def add_rpath_stuff(self):
+ all = self.to_list(getattr(self, 'use', []))
+ while all:
+ name = all.pop()
+ try:
+ tg = self.bld.get_tgen_by_name(name)
+ except:
+ continue
+ self.env.append_value('RPATH', tg.link_task.outputs[0].parent.abspath())
+ all.extend(self.to_list(getattr(tg, 'use', [])))
+