How to use the ninja.Writer 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 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 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 trezor / trezor-core / ninja / build.py View on Github external
w.build(
        "$builddir/genhdr/qstrdefs.generated.h",
        "qstr_generate",
        "$builddir/genhdr/qstrdefs.preprocessed.h",
    )

    w.variable("qstr", "$builddir/genhdr/qstrdefs.generated.h")


def build_object(path):
    base, ext = os.path.splitext(path)
    return "$builddir/%s.o" % base


with open("build_unix_debug.ninja", "w") as of:
    writer = ninja.Writer(of, 1024)
    common(writer)
    qstrings(writer)
    micropython(writer)
    extmod(writer)
    unix(writer)
    version(writer)

ninja

Ninja is a small build system with a focus on speed

Apache-2.0
Latest version published 22 days ago

Package Health Score

91 / 100
Full package analysis