device/trezor: webusb transport added, cmake fixes

- webusb transport based on libusb added. Provides direct access to Trezor via USB, no need for Trezor bridge.
- trezor protocol message handler improved, no recursion used. Ready for upcoming integration tests.
- libusb (for docker) bumped from v1.0.9 to v1.0.22, newer version required for webusb transport, for device enumeration.
- cmake improvements and fixes. Cmake Trezor checks are moved to a dedicated CheckTrezor.cmake file. In case of a problem Trezor is excluded from build.
- ifdefs made consistent to Ledger.
- UDP Transport enumeration disabled by default in release mode
This commit is contained in:
Dusan Klinec 2018-11-05 00:38:58 +01:00
parent 84dd674cd0
commit 2ffe53d9e6
No known key found for this signature in database
GPG key ID: 6337E118CCBCE103
16 changed files with 971 additions and 206 deletions

View file

@ -513,15 +513,8 @@ else (HIDAPI_FOUND)
message(STATUS "Could not find HIDAPI")
endif()
# Protobuf, optional. Required for TREZOR.
include(FindProtobuf)
find_package(Protobuf)
if(Protobuf_FOUND)
set(HAVE_PROTOBUF 1)
add_definitions(-DHAVE_PROTOBUF=1)
else(Protobuf_FOUND)
message(STATUS "Could not find Protobuf")
endif()
# Trezor support check
include(CheckTrezor)
if(MSVC)
add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__")
@ -921,7 +914,7 @@ endif()
list(APPEND EXTRA_LIBRARIES ${CMAKE_DL_LIBS})
if (HIDAPI_FOUND)
if (HIDAPI_FOUND OR LibUSB_COMPILE_TEST_PASSED)
if (APPLE)
if(DEPENDS)
list(APPEND EXTRA_LIBRARIES "-framework Foundation -framework IOKit")