Skip to content

Commit

Permalink
Add libusb detection code.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Sep 10, 2018
1 parent 68cc983 commit 3e6d7e0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Expand Up @@ -3,6 +3,7 @@ project(jtaghal)
set(CMAKE_BUILD_TYPE Release)

# Find JTAG drivers
find_library(USB_LIB usb-1.0)
find_library(FTD2XX_LIB ftd2xx)
find_library(DJTG_LIB djtg)

Expand All @@ -19,6 +20,12 @@ add_custom_target(
set(CMAKE_C_FLAGS "-g -Wall -Wextra -fsanitize=address")
set(CMAKE_CXX_FLAGS "-g -Wall -Wextra -fsanitize=address")

if(USB_LIB)
message(STATUS "Enabling libusb backend")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_LIBUSB")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -DHAVE_LIBUSB")
endif()

if(FTD2XX_LIB)
message(STATUS "Enabling FTDI backend (using D2XX blob)")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_FTD2XX")
Expand Down

0 comments on commit 3e6d7e0

Please sign in to comment.