How to use the ninja.BIN_DIR function in ninja

To help you get started, we’ve selected a few ninja examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github onnx / onnx / tools / ninja_builder.py View on Github external
def __init__(self, name):
        import ninja
        if not os.path.exists(BUILD_DIR):
            os.mkdir(BUILD_DIR)
        self.ninja_program = os.path.join(ninja.BIN_DIR, 'ninja')
        self.name = name
        self.filename = os.path.join(BUILD_DIR, 'build.{}.ninja'.format(name))
        self.writer = ninja.Writer(open(self.filename, 'w'))
        self.writer.rule('do_cmd', '$cmd')
        self.writer.rule('compile', '$cmd')
        self.compdb_targets = []
github slurps-mad-rips / brujeria / brujeria / mixin.py View on Github external
def build (self):
        yield
        self.writer.close()
        ninja_program = Path(ninja.BIN_DIR) / 'ninja'
        env = os.environ
        if not self.is_posix:
            # Add vcvarsall.bat to execution
            from distutils._msvccompiler import PLAT_TO_VCVARS, _get_vc_env
            from distutils.util import get_platform
            env = _get_vc_env(PLAT_TO_VCVARS[get_platform()])
        cmd = [str(ninja_program), '-f', str(self.writer.path)]
        import sys
        process = subprocess.Popen(cmd,
            env=env,
            universal_newlines=True,
            stdout=sys.stdout, #subprocess.PIPE,
            stderr=sys.stderr)#subprocess.PIPE)
        out, err = process.communicate()
        if process.returncode != 0:
            raise subprocess.CalledProcessError(
github pytorch / pytorch / tools / setup_helpers / ninja_builder.py View on Github external
def __init__(self, name):
        import ninja
        if not os.path.exists(BUILD_DIR):
            os.mkdir(BUILD_DIR)
        self.ninja_program = os.path.join(ninja.BIN_DIR, 'ninja')
        self.name = name
        self.filename = os.path.join(BUILD_DIR, 'build.{}.ninja'.format(name))
        self.writer = ninja.Writer(open(self.filename, 'w'))
        self.writer.rule('do_cmd', '$cmd')
        self.writer.rule('compile', '$cmd')
        self.compdb_targets = []
github slurps-mad-rips / brujeria / brujeria / ast.py View on Github external
def ninja_path (): return Path(ninja.BIN_DIR)

ninja

Ninja is a small build system with a focus on speed

Apache-2.0
Latest version published 7 months ago

Package Health Score

89 / 100
Full package analysis