Skip to content

Commit 37127b2

Browse files
committed
Allow DLL libusb libraries with variable
Add `PICOTOOL_LIBUSB_ALLOW_DLL` variable to switch back to the old behaviour, prior to #126
1 parent 8be60e9 commit 37127b2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cmake/FindLIBUSB.cmake

+5-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ else (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
5959
include(FindPackageHandleStandardArgs)
6060
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
6161

62-
# Don't use .dll.a libraries, as they require the .dll file to be in the correct location
63-
# Replace with .a for static linking instead
64-
string(REPLACE ".dll.a" ".a" LIBUSB_LIBRARIES ${LIBUSB_LIBRARIES})
62+
if (NOT PICOTOOL_LIBUSB_ALLOW_DLL)
63+
# Don't use .dll.a libraries, as they require the .dll file to be in the correct location
64+
# Replace with .a for static linking instead
65+
string(REPLACE ".dll.a" ".a" LIBUSB_LIBRARIES ${LIBUSB_LIBRARIES})
66+
endif()
6567

6668
MARK_AS_ADVANCED(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
6769
endif (LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)

0 commit comments

Comments
 (0)