externals: libusb: CMakeLists: Set platform flags for Windows/POSIX events and threads.
- Hopefully fixes MINGW builds.
This commit is contained in:
26
externals/libusb/CMakeLists.txt
vendored
26
externals/libusb/CMakeLists.txt
vendored
@@ -27,20 +27,24 @@ if(WIN32)
|
|||||||
target_include_directories(usb BEFORE PRIVATE libusb/msvc)
|
target_include_directories(usb BEFORE PRIVATE libusb/msvc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Works around other libraries providing their own definition of USB GUIDs (e.g. SDL2)
|
# Use platform-specific Windows APIs on MSVC and MINGW, and work around
|
||||||
target_compile_definitions(usb PRIVATE "-DGUID_DEVINTERFACE_USB_DEVICE=(GUID){ 0xA5DCBF10, 0x6530, 0x11D2, {0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED}}")
|
# other libraries providing their own definition of USB GUIDs (e.g. SDL2)
|
||||||
|
target_compile_definitions(usb PRIVATE "-DPLATFORM_WINDOWS=1 -DGUID_DEVINTERFACE_USB_DEVICE=(GUID){ 0xA5DCBF10, 0x6530, 0x11D2, {0x90, 0x1F, 0x00, 0xC0, 0x4F, 0xB9, 0x51, 0xED}}")
|
||||||
else()
|
else()
|
||||||
target_include_directories(usb
|
target_include_directories(usb
|
||||||
# turns out other projects also have "config.h", so make sure the
|
# turns out other projects also have "config.h", so make sure the
|
||||||
# LibUSB one comes first
|
# LibUSB one comes first
|
||||||
BEFORE
|
BEFORE
|
||||||
|
|
||||||
PUBLIC
|
PUBLIC
|
||||||
libusb/libusb
|
libusb/libusb
|
||||||
|
|
||||||
PRIVATE
|
PRIVATE
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Not on Windows, use POSIX APIs.
|
||||||
|
target_compile_definitions(usb PRIVATE "-DPLATFORM_POSIX=1")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WIN32 OR CYGWIN)
|
if(WIN32 OR CYGWIN)
|
||||||
|
|||||||
Reference in New Issue
Block a user