Пример #1
0
def install():
    destdir = directory(value('destdir', DEFAULT_PREFIX))
    include_dir = directory(destdir.join('usr').join('include').join('capnqml'))
    include_dir.ensure_exists()
    for file in directory('src').glob('^.*(hpp|capnp)$', exclude='.*test.*'):
        yield copy(file, include_dir.join(file.relative('src').path))
    bin_dir = directory(destdir.join('usr').join('bin'))
    bin_dir.ensure_exists()
    yield copy(ctx.builddir.join(ZMQLAUNCHER_NAME), bin_dir)
    lib_dir = directory(destdir.join('usr').join('lib'))
    lib_dir.ensure_exists()
    yield copy(ctx.builddir.join(LIBCAPNQML_NAME), lib_dir)
Пример #2
0
def compile_schema():
    tasks = []
    directory(ctx.builddir.join('schema')).ensure_exists()
    schema_sources = []
    for src in directory('src/schema').glob('.*\.capnp'):
        cmd = 'capnp compile --src-prefix=src/schema -oc++:{outp} {src_nobs}'
        tgt = file(ctx.builddir.join('schema').join(src.basename)).append_extension('.c++')
        capnp = shell(cmd, sources=src, targets=tgt)
        capnp.use(outp=ctx.builddir.join('schema'))
        # on windows, capnp compiler does not like backslashes, however
        # wasp formats with backslashes by default
        capnp.use(src_nobs=str(src).replace('\\', '/'))
        tasks.append(capnp)
        moved = tgt.replace_extension('cpp')
        mv = copy(tgt, moved).use(capnp)
        schema_sources.append(moved)
        tasks.append(mv)
    return tasks, schema_sources
Пример #3
0
 def run(self):
     yield copy(self.source, self.destination)