Skip to content

Commit

Permalink
HIDAPI: On UNIX systems complie the hid.c from source
Browse files Browse the repository at this point in the history
Signed-off-by: Norbert Takacs <[email protected]>
  • Loading branch information
norberttak committed Mar 22, 2024
1 parent 6f52ac7 commit 4ab7dbf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion 3rdparty/hidapi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ if (WIN32)

install(FILES lib/hidapi.dll DESTINATION ${PLUGIN_INSTALL_DIR})
else()
find_package(hidapi REQUIRED)
add_library(hidapi::hidapi STATIC IMPORTED GLOBAL
src/hid.c
)
target_include_directories(hidapi::hidapi INTERFACE headers)
endif()
10 changes: 8 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@ add_library(xpanel SHARED
devices/trc-1000/TRC1000Audio.cpp
)

target_include_directories(xpanel PRIVATE ./ core devices config-ui)
target_link_libraries(xpanel PRIVATE xpsdk::xpsdk hidapi::hidapi Lua::Lua FIPSDK::FIPSDK)
if (WIN32)
target_include_directories(xpanel PRIVATE ./ core devices config-ui)
target_link_libraries(xpanel PRIVATE xpsdk::xpsdk hidapi::hidapi Lua::Lua FIPSDK::FIPSDK)
else()
target_include_directories(xpanel PRIVATE ./ core devices config-ui ../3rdparty/hidapi/headers)
target_link_libraries(xpanel PRIVATE xpsdk::xpsdk Lua::Lua FIPSDK::FIPSDK)
endif()

set_target_properties(xpanel PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN TRUE)
target_compile_definitions(xpanel PRIVATE PLUGIN_SIGNATURE="${PROJECT_NAME_LOWERCASE}" PLUGIN_VERSION="${PROJECT_VERSION}")

Expand Down

0 comments on commit 4ab7dbf

Please sign in to comment.