def _run_cmake(ctx: PresubmitContext) -> None: build.install_package(ctx.package_root, 'nanopb') toolchain = ctx.root / 'pw_toolchain' / 'host_clang' / 'toolchain.cmake' build.cmake(ctx.root, ctx.output_dir, f'-DCMAKE_TOOLCHAIN_FILE={toolchain}', '-DCMAKE_EXPORT_COMPILE_COMMANDS=1', f'-Ddir_pw_third_party_nanopb={ctx.package_root / "nanopb"}', env=build.env_with_clang_vars())
def gn_teensy_build(ctx: PresubmitContext): build.install_package(ctx.package_root, 'teensy') build.gn_gen(ctx.root, ctx.output_dir, pw_arduino_build_CORE_PATH='"{}"'.format(str( ctx.package_root)), pw_arduino_build_CORE_NAME='teensy', pw_arduino_build_PACKAGE_NAME='teensy/avr', pw_arduino_build_BOARD='teensy40') build.ninja(ctx.output_dir, *_at_all_optimization_levels('arduino'))
def gn_nanopb_build(ctx: PresubmitContext): build.install_package(ctx.package_root, 'nanopb') build.gn_gen(ctx.root, ctx.output_dir, dir_pw_third_party_nanopb='"{}"'.format(ctx.package_root / 'nanopb')) build.ninja( ctx.output_dir, *_at_all_optimization_levels('stm32f429i'), *_at_all_optimization_levels('host_clang'), )