Skip to content

Commit

Permalink
cmake: Fix locating libusb header at configure-time
Browse files Browse the repository at this point in the history
Removing the CheckUSBHID call is necessary to avoid caching the failed header
check result before we find libusb via pkg-config.
  • Loading branch information
aeikum committed Jul 31, 2019
1 parent 1b7fc81 commit e149f4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Expand Up @@ -1128,7 +1128,9 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
endif()

if(SDL_JOYSTICK)
CheckUSBHID() # seems to be BSD specific - limit the test to BSD only?
if(FREEBSD OR NETBSD OR OPENBSD OR BSDI)
CheckUSBHID()
endif()
CheckHIDAPI()
if(LINUX AND NOT ANDROID)
set(SDL_JOYSTICK_LINUX 1)
Expand Down
2 changes: 1 addition & 1 deletion cmake/sdlchecks.cmake
Expand Up @@ -1074,7 +1074,7 @@ macro(CheckHIDAPI)
set(HAVE_HIDAPI FALSE)
pkg_check_modules(LIBUSB libusb)
if (LIBUSB_FOUND)
check_include_file(libusb.h HAVE_LIBUSB_H)
check_include_file(libusb.h HAVE_LIBUSB_H ${LIBUSB_CFLAGS})
if (HAVE_LIBUSB_H)
set(HAVE_HIDAPI TRUE)
endif()
Expand Down

0 comments on commit e149f4c

Please sign in to comment.