From 6d7419be0e4af0a4e04f31b867dfa8ff114b188f Mon Sep 17 00:00:00 2001 From: Jake Date: Fri, 28 Apr 2017 19:57:12 -0500 Subject: [PATCH] Add hidapi submodule, build updates / readme --- .gitmodules | 4 ++++ .travis.yml | 3 ++- 3rdparty/hidapi | 1 + CMakeLists.txt | 13 +++++++++++++ README.md | 2 +- appveyor.yml | 2 +- rpcs3/CMakeLists.txt | 5 +++-- 7 files changed, 25 insertions(+), 5 deletions(-) create mode 160000 3rdparty/hidapi diff --git a/.gitmodules b/.gitmodules index c62acab232..662e973d88 100644 --- a/.gitmodules +++ b/.gitmodules @@ -41,3 +41,7 @@ [submodule "rsx-debugger"] path = rsx-debugger url = https://github.com/RPCS3/rsx-debugger.git +[submodule "3rdparty/hidapi"] + path = 3rdparty/hidapi + url = https://github.com/RPCS3/hidapi + branch = master diff --git a/.travis.yml b/.travis.yml index 3140c48e22..596affa381 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,7 +51,7 @@ before_install: fi; before_script: - - git submodule update --init rsx_program_decompiler asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng Utilities/yaml-cpp 3rdparty/cereal + - git submodule update --init rsx_program_decompiler asmjit 3rdparty/ffmpeg 3rdparty/pugixml 3rdparty/GSL 3rdparty/libpng Utilities/yaml-cpp 3rdparty/cereal 3rdparty/hidapi - mkdir build - cd build - cmake .. @@ -84,6 +84,7 @@ addons: - lib32stdc++6 - zlib1g-dev - libwxgtk3.0-dev + - libudev-dev coverity_scan: project: name: $TRAVIS_REPO_SLUG diff --git a/3rdparty/hidapi b/3rdparty/hidapi new file mode 160000 index 0000000000..c095a22c53 --- /dev/null +++ b/3rdparty/hidapi @@ -0,0 +1 @@ +Subproject commit c095a22c53f13ccafc54dc59b5c882cd4036afd9 diff --git a/CMakeLists.txt b/CMakeLists.txt index c8034aeb6e..de794b2be2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,3 +47,16 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${PROJECT_BINARY_DIR}/bin") add_subdirectory( Vulkan ) add_subdirectory( rpcs3 ) add_subdirectory( rsx_program_decompiler ) + +include_directories(3rdparty/hidapi/hidapi) +if(APPLE) + add_subdirectory(3rdparty/hidapi/mac) + #list(APPEND LIBS hidapi) +elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + add_subdirectory(3rdparty/hidapi/linux) +elseif(MSVC) + add_subdirectory(3rdparty/hidapi/windows) +else() + add_subdirectory(3rdparty/hidapi/libusb) + #list(APPEND LIBS hidapi-libusb) +endif() diff --git a/README.md b/README.md index 5c682d3f73..1f4dc0e440 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ __Windows__ __Linux__ * GCC 5.1+ or Clang 3.5.0+ ([not GCC 6.1](https://github.com/RPCS3/rpcs3/issues/1691)) -* Debian & Ubuntu: `sudo apt-get install cmake build-essential libasound2-dev libopenal-dev libwxgtk3.0-dev libglew-dev zlib1g-dev libedit-dev libvulkan-dev git` +* Debian & Ubuntu: `sudo apt-get install cmake build-essential libasound2-dev libopenal-dev libwxgtk3.0-dev libglew-dev zlib1g-dev libedit-dev libvulkan-dev libudev-dev git` * Arch: `sudo pacman -S glew openal wxgtk cmake llvm` __Mac OSX__ diff --git a/appveyor.yml b/appveyor.yml index d803efb863..b247243c90 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,7 +12,7 @@ configuration: before_build: - ps: $env:Date="$(git show -s --date=short --format='%ad')" - - git submodule update --init 3rdparty/ffmpeg 3rdparty/pugixml asmjit 3rdparty/GSL 3rdparty/libpng Vulkan/glslang Vulkan/Vulkan-LoaderAndValidationLayers Utilities/yaml-cpp rsx_program_decompiler 3rdparty/cereal + - git submodule update --init 3rdparty/ffmpeg 3rdparty/pugixml asmjit 3rdparty/GSL 3rdparty/libpng Vulkan/glslang Vulkan/Vulkan-LoaderAndValidationLayers Utilities/yaml-cpp rsx_program_decompiler 3rdparty/cereal 3rdparty/hidapi - 7z x wxWidgets.7z -aos -oC:\rpcs3\wxWidgets > null - 7z x zlib.7z -aos -oC:\rpcs3\ > null - 7z x vulkan.7z -aos -oC:\rpcs3\Vulkan > null diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index c1496d24c6..a2c2de5868 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -142,6 +142,7 @@ ${LLVM_INCLUDE_DIRS} "${RPCS3_SRC_DIR}/../rsx_program_decompiler/shader_code" "${RPCS3_SRC_DIR}/../Vulkan/Vulkan-LoaderAndValidationLayers/include" "${RPCS3_SRC_DIR}/../Vulkan/glslang/glslang/Public" +"${RPCS3_SRC_DIR}/../3rdparty/hidapi/hidapi" # Includes 3rdparty stuff that isn't included yet "${RPCS3_SRC_DIR}/../3rdparty/GL" "${RPCS3_SRC_DIR}/../3rdparty/stblib" @@ -214,7 +215,7 @@ if(MSVC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /DYNAMICBASE:NO /BASE:0x10000 /FIXED") endif() if(WIN32) - target_link_libraries(rpcs3 ws2_32.lib Winmm.lib Psapi.lib VKstatic.1 glslang OSDependent OGLCompiler SPIRV HLSL) + target_link_libraries(rpcs3 ws2_32.lib Winmm.lib Psapi.lib VKstatic.1 glslang OSDependent OGLCompiler SPIRV HLSL setupapi.lib hidapi-hid) if(NOT MSVC) target_link_libraries(rpcs3 ${OPENGL_LIBRARIES} ${GLEW_LIBRARY} opengl32.lib glu32.lib libpthread) else() @@ -222,7 +223,7 @@ if(WIN32) endif() target_link_libraries(rpcs3 avformat.lib avcodec.lib avutil.lib swresample.lib swscale.lib png16_static ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${ADDITIONAL_LIBS}) else() - target_link_libraries(rpcs3 ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES}) + target_link_libraries(rpcs3 ${wxWidgets_LIBRARIES} ${OPENAL_LIBRARY} ${GLEW_LIBRARY} ${OPENGL_LIBRARIES} hidapi-hidraw udev) target_link_libraries(rpcs3 -ldl ${ZLIB_LIBRARIES} ${ADDITIONAL_LIBS}) if (USE_SYSTEM_FFMPEG) link_libraries(${FFMPEG_LIBRARY_DIR})