From 017d8fd39e55a120da119a5024ecce19a63d8a93 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Thu, 17 Mar 2016 22:56:34 +0100 Subject: [PATCH] Use relative paths in apply_incpaths by default Relative paths are usually best for for specialized compilers (emscripten), so this is for convenience. Absolute paths are usually faster. --- ChangeLog | 1 + TODO | 1 - waflib/Tools/ccroot.py | 2 +- waflib/extras/c_emscripten.py | 13 ------------- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02922ec6..f848a573 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,4 +27,5 @@ NEW IN WAF 1.9 - Remove Utils.nogc - Modify Utils.run_once so that it accepts a list of *args - Improve the task consumer in Runner.py + - Use relative paths in apply_incpaths by default (and absolute ones when paths cross drives) diff --git a/TODO b/TODO index 3c5af0ff..9e95ba34 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,6 @@ Waf 1.9 * Better consistency between check_cfg and check_cc variables * Let more context commands depend on the configuration * Rework qt5 -* Use relative paths in apply_incpaths (and absolute ones when paths cross drives) * Regexps for extension-based processing * Other issues listed on https://github.com/waf-project/waf/issues diff --git a/waflib/Tools/ccroot.py b/waflib/Tools/ccroot.py index 3227858e..607999f9 100644 --- a/waflib/Tools/ccroot.py +++ b/waflib/Tools/ccroot.py @@ -120,7 +120,7 @@ def apply_incpaths(self): lst = self.to_incnodes(self.to_list(getattr(self, 'includes', [])) + self.env['INCLUDES']) self.includes_nodes = lst - self.env['INCPATHS'] = [x.abspath() for x in lst] + self.env['INCPATHS'] = [x.path_from(self.bld.bldnode) for x in lst] class link_task(Task.Task): """ diff --git a/waflib/extras/c_emscripten.py b/waflib/extras/c_emscripten.py index 7fde57ec..6881320a 100644 --- a/waflib/extras/c_emscripten.py +++ b/waflib/extras/c_emscripten.py @@ -82,16 +82,3 @@ def configure(conf): conf.env.cxxprogram_PATTERN = '%s.html' conf.env.append_value('LINKFLAGS',['-Wl,--enable-auto-import']) -@feature('c', 'cxx', 'acm', 'includes') -@after_method('propagate_uselib_vars', 'process_source', 'apply_incpaths') -def apply_incpaths_emscripten(self): - """ - Emscripten doesn't like absolute include paths - """ - # TODO: in waf 1.9 we can switch back to bldnode as the default since path_from handles cross-drive paths - if self.env.CC_NAME != 'emscripten' or self.env.CC_NAME != 'emscripten': - return - lst = self.to_incnodes(self.to_list(getattr(self, 'includes', [])) + self.env['INCLUDES']) - self.includes_nodes = lst - self.env['INCPATHS'] = [x.path_from(self.bld.bldnode) for x in lst] -