summaryrefslogtreecommitdiff
path: root/third_party/waf/waflib/Tools/ccroot.py
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/waf/waflib/Tools/ccroot.py')
-rw-r--r--third_party/waf/waflib/Tools/ccroot.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/third_party/waf/waflib/Tools/ccroot.py b/third_party/waf/waflib/Tools/ccroot.py
index 506bd12445b..6a425fd8f4d 100644
--- a/third_party/waf/waflib/Tools/ccroot.py
+++ b/third_party/waf/waflib/Tools/ccroot.py
@@ -4,7 +4,7 @@
#!/usr/bin/env python
# encoding: utf-8
-# Thomas Nagy, 2005-2016 (ita)
+# Thomas Nagy, 2005-2018 (ita)
"""
Classes and methods shared by tools providing support for C-like language such
@@ -135,6 +135,9 @@ class link_task(Task.Task):
"""
color = 'YELLOW'
+ weight = 3
+ """Try to process link tasks as early as possible"""
+
inst_to = None
"""Default installation path for the link task outputs, or None to disable"""
@@ -231,8 +234,10 @@ class stlink_task(link_task):
def rm_tgt(cls):
old = cls.run
def wrap(self):
- try: os.remove(self.outputs[0].abspath())
- except OSError: pass
+ try:
+ os.remove(self.outputs[0].abspath())
+ except OSError:
+ pass
return old(self)
setattr(cls, 'run', wrap)
rm_tgt(stlink_task)
@@ -272,7 +277,7 @@ def apply_link(self):
try:
inst_to = self.install_path
except AttributeError:
- inst_to = self.link_task.__class__.inst_to
+ inst_to = self.link_task.inst_to
if inst_to:
# install a copy of the node list we have at this moment (implib not added)
self.install_task = self.add_install_files(
@@ -395,7 +400,8 @@ def process_use(self):
self.add_objects_from_tgen(y)
if getattr(y, 'export_includes', None):
- self.includes.extend(y.to_incnodes(y.export_includes))
+ # self.includes may come from a global variable #2035
+ self.includes = self.includes + y.to_incnodes(y.export_includes)
if getattr(y, 'export_defines', None):
self.env.append_value('DEFINES', self.to_list(y.export_defines))
@@ -597,7 +603,7 @@ def apply_vnum(self):
self.create_task('vnum', node, outs)
if getattr(self, 'install_task', None):
- self.install_task.hasrun = Task.SKIP_ME
+ self.install_task.hasrun = Task.SKIPPED
path = self.install_task.install_to
if self.env.DEST_OS == 'openbsd':
libname = self.link_task.outputs[0].name
@@ -617,7 +623,7 @@ def apply_vnum(self):
try:
inst_to = self.install_path
except AttributeError:
- inst_to = self.link_task.__class__.inst_to
+ inst_to = self.link_task.inst_to
if inst_to:
p = Utils.subst_vars(inst_to, self.env)
path = os.path.join(p, name2)
@@ -770,3 +776,4 @@ def set_full_paths_hpux(self):
else:
lst.append(os.path.normpath(os.path.join(base, x)))
self.env[var] = lst
+