Merge pull request #5749

45c28d8 build: fix OSX static libusb check and link against static libobjc (xiphon)
This commit is contained in:
luigi1111 2019-08-21 15:19:33 -05:00
commit 0ca1a51033
No known key found for this signature in database
GPG Key ID: F4ACA0183641E010
2 changed files with 8 additions and 2 deletions

View File

@ -159,7 +159,7 @@ if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON AND Protobuf_COMPILE_T
set(TREZOR_LIBUSB_LIBRARIES "") set(TREZOR_LIBUSB_LIBRARIES "")
if(LibUSB_COMPILE_TEST_PASSED) if(LibUSB_COMPILE_TEST_PASSED)
list(APPEND TREZOR_LIBUSB_LIBRARIES ${LibUSB_LIBRARIES}) list(APPEND TREZOR_LIBUSB_LIBRARIES ${LibUSB_LIBRARIES} ${LIBUSB_DEP_LINKER})
message(STATUS "Trezor compatible LibUSB found at: ${LibUSB_INCLUDE_DIRS}") message(STATUS "Trezor compatible LibUSB found at: ${LibUSB_INCLUDE_DIRS}")
endif() endif()
@ -174,7 +174,7 @@ if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON AND Protobuf_COMPILE_T
if (TREZOR_LIBUSB_LIBRARIES) if (TREZOR_LIBUSB_LIBRARIES)
list(APPEND TREZOR_DEP_LIBS ${TREZOR_LIBUSB_LIBRARIES}) list(APPEND TREZOR_DEP_LIBS ${TREZOR_LIBUSB_LIBRARIES})
string(APPEND TREZOR_DEP_LINKER " -lusb-1.0") string(APPEND TREZOR_DEP_LINKER " -lusb-1.0 ${LIBUSB_DEP_LINKER}")
endif() endif()
endif() endif()
endif() endif()

View File

@ -119,6 +119,12 @@ if ( LibUSB_FOUND )
find_library(IOKIT IOKit) find_library(IOKIT IOKit)
list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${IOKIT}) list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${IOKIT})
list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${COREFOUNDATION}) list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${COREFOUNDATION})
if(STATIC)
find_library(OBJC objc.a)
set(LIBUSB_DEP_LINKER ${OBJC})
list(APPEND TEST_COMPILE_EXTRA_LIBRARIES ${LIBUSB_DEP_LINKER})
endif()
endif() endif()
endif() endif()
if (WIN32) if (WIN32)