Cmake hidapi fixed conditional build

This commit is contained in:
dando92
2025-03-27 22:36:29 -07:00
committed by teejusb
parent 5d1383572d
commit 5cfa78c4dd
+5 -9
View File
@@ -1,11 +1,5 @@
set(HIDAPI_HPP "hidapi/hidapi/hidapi.h") set(HIDAPI_HPP "hidapi/hidapi/hidapi.h")
if(APPLE)
set(HIDAPI_SRC "hidapi/mac/hid.c")
list(APPEND HIDAPI_HPP
"hidapi/mac/hidapi_darwin.h")
endif()
if(WIN32) if(WIN32)
set(HIDAPI_SRC "hidapi/windows/hid.c" "hidapi/windows/hidapi_descriptor_reconstruct.c") set(HIDAPI_SRC "hidapi/windows/hid.c" "hidapi/windows/hidapi_descriptor_reconstruct.c")
list(APPEND HIDAPI_HPP list(APPEND HIDAPI_HPP
@@ -15,9 +9,11 @@ if(WIN32)
"hidapi/windows/hidapi_hidpi.h" "hidapi/windows/hidapi_hidpi.h"
"hidapi/windows/hidapi_hidsdi.h" "hidapi/windows/hidapi_hidsdi.h"
"hidapi/windows/hidapi_winapi.h") "hidapi/windows/hidapi_winapi.h")
endif() elseif(APPLE)
set(HIDAPI_SRC "hidapi/mac/hid.c")
if(UNIX) list(APPEND HIDAPI_HPP
"hidapi/mac/hidapi_darwin.h")
else() #Unix
set(HIDAPI_SRC "hidapi/linux/hid.c") set(HIDAPI_SRC "hidapi/linux/hid.c")
endif() endif()