src/main: add specific -D to enable/disable --device arg

This commit is contained in:
Gwenhael Goavec-Merou 2022-09-17 17:33:25 +02:00
parent 27d64e0248
commit 8f59294f45
2 changed files with 5 additions and 1 deletions

View File

@ -216,6 +216,10 @@ if (ENABLE_LIBGPIOD)
message("libgpiod support enabled")
endif(ENABLE_LIBGPIOD)
if (ENABLE_UDEV OR ENABLE_LIBGPIOD)
add_definitions(-DUSE_DEVICE_ARG)
endif(ENABLE_UDEV OR ENABLE_LIBGPIOD)
if (BUILD_STATIC)
set_target_properties(openFPGALoader PROPERTIES LINK_SEARCH_END_STATIC 1)
endif()

View File

@ -656,7 +656,7 @@ int parse_opt(int argc, char **argv, struct arguments *args, jtag_pins_conf_t *p
("ftdi-serial", "FTDI chip serial number", cxxopts::value<string>(args->ftdi_serial))
("ftdi-channel", "FTDI chip channel number (channels 0-3 map to A-D)", cxxopts::value<int>(args->ftdi_channel))
#if defined(USE_UDEV) || defined(ENABLE_LIBGPIOD)
#if defined(USE_DEVICE_ARG)
("d,device", "device to use (/dev/ttyUSBx)",
cxxopts::value<string>(args->device))
#endif