def configure(): debug = value('debug', False) build_type = 'debug' if debug else 'release' native_arch = 'x64' if osinfo.x64 else 'x86' arch = value('msvc_arch') or native_arch capnpdir = directory('3rdparty/capnproto/windows/') capnplibdir = capnpdir.join(arch + '-' + build_type) inc = get_includes() inc.append('submodules/capnproto/c++/src') cli = cpp.CompilerCli(cpp.DEFAULT_COMPILER) node(':config').write({ 'includes': inc, 'debug': debug, 'libraries': [capnplibdir.join('capnp.lib'), capnplibdir.join('kj.lib')], 'defines': 'CAPNP_LITE', 'cflags': cli.default_flags(debug=debug, arch=arch) }) python_dir = value('python_dir') if python_dir is None: raise CommandFailedError("Be sure to specify the `python_dir` argument somewhere!") python_dir = directory(python_dir) node(':python').write({ 'includes': python_dir.join('include'), 'libraries': python_dir.join('libs/python35.lib'), })
def configure(): debug = value('debug', False) yield cpp.find_cxx(debug=debug) inc = get_includes() inc.append('/usr/include') cli = cpp.CompilerCli(cpp.DEFAULT_COMPILER) cflags = [cli.position_independent_code, '-DPIC', '-pthread', cli.enable_exceptions, '-std=gnu++14'] if debug: cflags += ['-g', '-O0', '-DDEBUG', '-DQT_QML_DEBUG'] else: cflags += ['-O3', '-DNDEBUG'] node(':config').write({ 'includes': inc, 'debug': debug, 'libraries': ['capnp', 'kj', 'zmq'], 'cflags': cflags }) name = re.compile('libpython3\.(?P<minor>[0-9]).*?\.so') yield find(name, dirs='/usr/lib', argprefix='libraries').produce(':python-lib') name = re.compile('python3\.(?P<minor>[0-9]).*?$') yield find(name, dirs='/usr/include', argprefix='includes').produce(':python-includes') node(':python-pybind11').write({ 'includes': 'submodules/pybind11/include' }) yield collect(':python-lib', ':python-includes', ':python-pybind11').produce(':python')
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)