mirror of https://gitlab.com/ita1024/waf.git
Simplify waflib/extras/force_build_directory.py
This commit is contained in:
parent
c142062d69
commit
6c48f08e97
|
@ -11,17 +11,12 @@ Force all build files to go to the build directory:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from waflib import Node, Utils
|
from waflib import Node
|
||||||
|
|
||||||
def find_or_declare(self, lst):
|
def find_or_declare(self, lst):
|
||||||
if isinstance(lst, str):
|
if isinstance(lst, str) and os.path.isabs(lst):
|
||||||
lst = [x for x in Utils.split_path(lst) if x and x != '.']
|
node = self.ctx.root.make_node(lst)
|
||||||
|
else:
|
||||||
node = self.get_bld().search_node(lst)
|
|
||||||
if node:
|
|
||||||
if not os.path.isfile(node.abspath()):
|
|
||||||
node.parent.mkdir()
|
|
||||||
return node
|
|
||||||
node = self.get_bld().make_node(lst)
|
node = self.get_bld().make_node(lst)
|
||||||
node.parent.mkdir()
|
node.parent.mkdir()
|
||||||
return node
|
return node
|
||||||
|
|
Loading…
Reference in New Issue