You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
waf_old/waflib/extras/force_build_directory.py

24 lines
454 B
Python

#!/usr/bin/env python
# coding=utf-8
# Thomas Nagy, 2016
"""
Force all build files to go to the build directory:
def options(opt):
opt.load('force_build_directory')
"""
import os
from waflib import Node
def find_or_declare(self, lst):
if isinstance(lst, str) and os.path.isabs(lst):
node = self.ctx.root.make_node(lst)
else:
node = self.get_bld().make_node(lst)
node.parent.mkdir()
return node
Node.Node.find_or_declare = find_or_declare