Skip to content

Commit

Permalink
Add option force use OldUSB to compatiable with ubuntun18.04
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Li <[email protected]>
  • Loading branch information
nxpfrankli committed Aug 1, 2023
1 parent 1fde24c commit fa35b3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions libuuu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ endif()
include_directories(${LIBUSB_INCLUDE_DIRS} ${LIBZSTD_INCLUDE_DIRS} ${UUUOPENSLL_INCLUDE_DIR} include)


set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wstrict-aliasing -Wextra ${UUUSSL}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 ${UUUSSL}")
if (FORCE_OLD)
set(FORCE_OLDLIBUSB "-DFORCE_OLDLIBUSB")
endif()

set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wstrict-aliasing -Wextra ${UUUSSL} ${FORCE_OLDLIBUSB}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 ${UUUSSL} ${FORCE_OLDLIBUSB}")

set(SOURCES
error.cpp
Expand Down
2 changes: 1 addition & 1 deletion libuuu/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void uuu_set_debug_level(uint32_t mask)
{
g_debug_level = mask;

#if LIBUSB_API_VERSION > 0x01000106
#if LIBUSB_API_VERSION > 0x01000106 && !defined(FORCE_OLDLIBUSB)
libusb_set_option(nullptr, LIBUSB_OPTION_LOG_LEVEL, get_libusb_debug_level());
#else
libusb_set_debug(nullptr, get_libusb_debug_level());
Expand Down

0 comments on commit fa35b3c

Please sign in to comment.