Fix timespec for MSVC

This commit is contained in:
msuih 2019-04-11 15:23:49 +03:00 committed by Ivan
parent 52a12185a0
commit af86d1d77a

View File

@ -91,6 +91,10 @@ if(CMAKE_SYSTEM MATCHES "DragonFly|FreeBSD")
# Always use system libusb as reference implementation isn't supported
add_library(usb-1.0-static INTERFACE)
target_link_libraries(usb-1.0-static INTERFACE usb)
elseif(MSVC)
# Windows time.h defines timespec but doesn't add any flag for it, which makes libusb attempt to define it again
add_definitions(-DHAVE_STRUCT_TIMESPEC=1)
add_subdirectory(libusb EXCLUDE_FROM_ALL)
else()
add_subdirectory(libusb EXCLUDE_FROM_ALL)
endif()