Skip to content

Commit

Permalink
Only include bdev if has_libusb
Browse files Browse the repository at this point in the history
  • Loading branch information
will-v-pi committed Nov 27, 2024
1 parent 626beaa commit 9287b1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ target_link_libraries(picotool
elf2uf2
errors
nlohmann_json
littlefs
whereami)

if (NOT TARGET mbedtls)
Expand All @@ -291,6 +290,7 @@ else()
target_compile_definitions(picotool PRIVATE HAS_LIBUSB=1)
target_link_libraries(picotool
picoboot_connection_cxx
littlefs
${LIBUSB_LIBRARIES})
endif()

Expand Down
5 changes: 3 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "picoboot_connection_cxx.h"
#include "rp2350.rom.h"
#include "xip_ram_perms.h"
#include "lfs.h"
#else
#include "picoboot_connection.h"
#endif
Expand All @@ -52,8 +53,6 @@

#include "nlohmann/json.hpp"

#include "lfs.h"

#if defined(__unix__) || defined(__APPLE__)
#include <unistd.h>
#endif
Expand Down Expand Up @@ -1459,7 +1458,9 @@ auto help_cmd = std::shared_ptr<help_command>(new help_command());

vector<std::shared_ptr<cmd>> commands {
std::shared_ptr<cmd>(new info_command()),
#if HAS_LIBUSB
std::shared_ptr<cmd>(new bdev_command()),
#endif
std::shared_ptr<cmd>(new config_command()),
#if HAS_LIBUSB
std::shared_ptr<cmd>(new load_command()),
Expand Down

0 comments on commit 9287b1a

Please sign in to comment.