|
| 1 | +package(default_visibility = ["//visibility:public"]) |
| 2 | + |
| 3 | +cc_binary( |
| 4 | + name = "picotool", |
| 5 | + srcs = [ |
| 6 | + "cli.h", |
| 7 | + "clipp/clipp.h", |
| 8 | + "elf.h", |
| 9 | + "main.cpp", |
| 10 | + "picoboot_connection/picoboot_connection.c", |
| 11 | + "picoboot_connection/picoboot_connection.h", |
| 12 | + "picoboot_connection/picoboot_connection_cxx.cpp", |
| 13 | + "picoboot_connection/picoboot_connection_cxx.h", |
| 14 | + ], |
| 15 | + copts = select({ |
| 16 | + "@platforms//os:windows": [], |
| 17 | + "//conditions:default": [ |
| 18 | + "-fexceptions", |
| 19 | + "-Wno-delete-non-abstract-non-virtual-dtor", |
| 20 | + "-Wno-reorder-ctor", |
| 21 | + "-Wno-unused-variable", |
| 22 | + ], |
| 23 | + }), |
| 24 | + # TODO: There's probably a nicer way to do share this with CMake. |
| 25 | + defines = [ |
| 26 | + 'PICOTOOL_VERSION=\\"1.1.3-rc1\\"', |
| 27 | + 'SYSTEM_VERSION=\\"host\\"', |
| 28 | + 'COMPILER_INFO=\\"local\\"', |
| 29 | + ], |
| 30 | + # Windows does not behave nicely with the automagic force_dynamic_linkage_enabled. |
| 31 | + dynamic_deps = select({ |
| 32 | + "@rules_libusb//:force_dynamic_linkage_enabled": ["@libusb//:libusb_dynamic"], |
| 33 | + "//conditions:default": [], |
| 34 | + }), |
| 35 | + includes = ["picoboot_connection"], |
| 36 | + deps = [ |
| 37 | + "@libusb", |
| 38 | + "@pico-sdk//src/common/boot_picoboot:boot_picoboot", |
| 39 | + "@pico-sdk//src/common/boot_uf2:boot_uf2", |
| 40 | + "@pico-sdk//src/common/pico_base:platform_defs", |
| 41 | + "@pico-sdk//src/common/pico_binary_info:pico_binary_info", |
| 42 | + "@pico-sdk//src/rp2_common/pico_stdio_usb:reset_interface_headers", |
| 43 | + ], |
| 44 | +) |
0 commit comments