Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/Tools/ardupilotwaf/gbenchmark.py
Views: 1798
# encoding: utf-812"""3gbenchmark is a Waf tool for benchmark builds in Ardupilot4"""56from waflib import Build, Context, Task7from waflib.Configure import conf8from waflib.TaskGen import feature, before_method, after_method9from waflib.Errors import WafError1011def configure(cfg):12env = cfg.env13env.HAS_GBENCHMARK = False1415if env.TOOLCHAIN != 'native':16cfg.msg(17'Gbenchmark',18'cross-compilation currently not supported',19color='YELLOW',20)21return2223cfg.load('cmake')2425env.GBENCHMARK_PREFIX_REL = 'gbenchmark'2627bldnode = cfg.bldnode.make_node(cfg.variant)28prefix_node = bldnode.make_node(env.GBENCHMARK_PREFIX_REL)2930env.INCLUDES_GBENCHMARK = [prefix_node.make_node('include').abspath()]31env.LIBPATH_GBENCHMARK = [prefix_node.make_node('lib').abspath()]32env.LIB_GBENCHMARK = ['benchmark']3334env.append_value('GIT_SUBMODULES', 'gbenchmark')35env.HAS_GBENCHMARK = True3637@conf38def libbenchmark(bld):39prefix_node = bld.bldnode.make_node(bld.env.GBENCHMARK_PREFIX_REL)4041gbenchmark = bld.cmake(42name='gbenchmark',43cmake_src='modules/gbenchmark',44cmake_bld='gbenchmark_build',45cmake_vars=dict(46CMAKE_BUILD_TYPE='Release',47CMAKE_INSTALL_PREFIX=prefix_node.abspath(),48BENCHMARK_ENABLE_GTEST_TESTS='OFF',49BENCHMARK_ENABLE_TESTING='OFF',50),51)5253prefix_node = bld.bldnode.make_node(bld.env.GBENCHMARK_PREFIX_REL)54output_paths = (55'lib/libbenchmark.a',56'include/benchmark/benchmark.h',57)58outputs = [prefix_node.make_node(path) for path in output_paths]59gbenchmark.build('install', target=outputs)6061@feature('gbenchmark')62@before_method('process_use')63def append_gbenchmark_use(self):64self.use = self.to_list(getattr(self, 'use', []))65if 'GBENCHMARK' not in self.use:66self.use.append('GBENCHMARK')6768@feature('gbenchmark')69@after_method('process_source')70def wait_for_gbenchmark_install(self):71gbenchmark_install = self.bld.get_tgen_by_name('gbenchmark_install')72gbenchmark_install.post()7374for task in self.compiled_tasks:75task.set_run_after(gbenchmark_install.cmake_build_task)76task.dep_nodes.extend(gbenchmark_install.cmake_build_task.outputs)777879