Skip to content

Commit

Permalink
Fix build under MSYS2 MinGW-w64 (Windows)
Browse files Browse the repository at this point in the history
- Under MSYS2 MinGW-w64 the filename of the hidapi import library
  is "libhidapi.dll.a". Add hidapi.dll to NAMES of findlibrary().
  • Loading branch information
c72578 committed Dec 9, 2019
1 parent e4c5a3a commit b85f959
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ find_path(HIDAPI_HEADER_DIR hidapi.h
)

if (BUILD_HIDAPI_SHARED)
find_library(HIDAPI_LIB NAMES hidapi-hidraw hidapi-libusb
# Under MSYS2 MinGW-w64 the filename of the import library is libhidapi.dll.a
find_library(HIDAPI_LIB NAMES hidapi-hidraw hidapi-libusb hidapi.dll
PATHS ../hidapi ../hidapi.git
PATH_SUFFIXES linux/.libs libusb/.libs linux libusb mac
DOC "The location of the HIDAPI shared library file"
Expand Down

0 comments on commit b85f959

Please sign in to comment.