def generate_project(project_path, project_name): project = Project(project_name) extensions = [Package('opencv')] configure_gcc(gcc_command='g++', ccache=False) compile = Phase() compile.executor = GccCompile() compile.extensions += extensions compile.inputs = glob(project_path + '*.cpp') compile.executor.hooks.append(debug_hook) link = Phase() link.executor = GccLink() link.inputs_from.append(compile) link.extensions += extensions link.output = 'opencv' link.executor.hooks.append(debug_hook) if ctx.build.run: link.run_output = 1 argv = str(ctx.get('args.argv')) print("Running with " + argv) to_run = ["{output}", argv] link.run_command = to_run project.phases['link'] = link project.phases['compile'] = compile return project
columns=100, strict=False) configure_gcc(gcc_command='gcc', ccache=True, ccache_path='/usr/lib/ccache') configure_pkg_config(pkg_config_command='pkg-config', pkg_config_path=None) project = Project('gcc GTK+ Hello World') extensions = [Package('gtk+-3.0')] # Compile comp = Phase() comp.executor = GccCompile() comp.inputs = glob('src/**/*.c') comp.extensions += extensions project.phases['compile'] = comp # Link link = Phase() link.executor = GccLink() link.inputs_from.append(comp) link.extensions += extensions link.output = 'example_1' if ctx.build.run: link.run_output = 1 project.phases['link'] = link cli(project)
executor.optimize('0') with new_context() as ctx: project = Project('Genetic-Algo') # extensions = [Package('OpenCV')] extensions = [] configure_gcc(gcc_command='g++', ccache=False) compile = Phase() compile.executor = GccCompile() compile.extensions += extensions compile.inputs = glob('**/*.cpp') compile.executor.hooks.append(debug_hook) compile.executor.enable_warning(value='all') link = Phase() link.executor = GccLink() link.inputs_from.append(compile) link.extensions += extensions link.output = 'gen-algo' link.executor.hooks.append(debug_hook) if ctx.build.run: link.run_output = 1 project.phases['link'] = link project.phases['compile'] = compile cli(project)