-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Linux support #90
Open
AngriestSCV
wants to merge
27
commits into
pushrax:master
Choose a base branch
from
AngriestSCV:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
5453ed7
Compiles on linux, UDP based IPC for driver, no linux hooking capabil…
AngriestSCV d23704e
Added CMake & openvr
AngriestSCV ab9f0e5
Cleaning up build
AngriestSCV 8c11089
CMake improvements
AngriestSCV 095b335
Updating manifest handling
AngriestSCV fddc727
Improved gitignore
AngriestSCV a6081d6
Swaping out verbose preprocessor platform checks
AngriestSCV 01442d2
Build fixes
AngriestSCV 7f2e041
Fixing new clone build issue
AngriestSCV bfa1c3e
Imporving initial build process on Linux
AngriestSCV e66339e
Fixing reversed mouse in Linux VR
AngriestSCV 2360f80
Allow for better handling of dropped UDP packets
AngriestSCV 5d34f84
Reducing windows delta
AngriestSCV 5adc5f2
Moving linux config path to StaticConfig
AngriestSCV 2debe7d
Windows compatibility fix
AngriestSCV d69aac3
better readme to include Linux build instructions
AngriestSCV de98a3a
Linux config file fixes
AngriestSCV 87d174b
Fixing up some fresh build issues.
AngriestSCV 723c10a
Fixing config finding bug
AngriestSCV d70cb84
First steps on resolving change requests
AngriestSCV e6c76e1
Builds again after stripping many preprocessor statements
AngriestSCV e5087a0
Linux changes!
AngriestSCV 67ec6b5
Better .gitignore
AngriestSCV dda4445
Builds under linux again, now with much less preprocessor
AngriestSCV c1511a3
Add executable to memory permissions when writing hook
AngriestSCV e5b0bae
Reverting logging change
AngriestSCV a4151fc
Replacing spaces with tabs
AngriestSCV File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[submodule "OpenVR-SpaceCalibrator/gl3w"] | ||
path = OpenVR-SpaceCalibrator/gl3w | ||
url = https://github.com/skaslev/gl3w.git | ||
[submodule "modules/imgui"] | ||
path = modules/imgui | ||
url = https://github.com/ocornut/imgui.git | ||
[submodule "modules/openvr"] | ||
path = modules/openvr | ||
url = https://github.com/ValveSoftware/openvr.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project (OpenVR-SpaceCalibrator VERSION 1.0) | ||
add_definitions(-D__linux__) | ||
|
||
set(CMAKE_BUILD_TYPE Debug) | ||
set(DRIVER_LOG_FILE "/tmp/spaceCalDriverLog.txt" CACHE PATH "Driver Log Path" ) | ||
set(LINUX_CONFIG_DIR ".config/OpenVR-SpaceCalibrator" CACHE PATH "Config subdirectory (from HOME)" ) | ||
|
||
add_library(imgui | ||
lib/imgui/imgui.cpp | ||
lib/imgui/imgui_demo.cpp | ||
lib/imgui/imgui_draw.cpp | ||
lib/imgui/imgui_impl_glfw.cpp | ||
lib/imgui/imgui_impl_opengl3.cpp | ||
modules/imgui/backends/imgui_impl_glfw.cpp | ||
) | ||
|
||
find_library(glfw libglfw.so) | ||
find_library(GL libGL.so) | ||
find_library( openvr_api libopenvr_api.so PATHS ./modules/openvr/bin/linux64/libopenvr_api.so ) | ||
|
||
include_directories(OpenVR-SpaceCalibratorDriver) | ||
include_directories(/usr/include/eigen3) | ||
include_directories(lib/gl3w/include) | ||
include_directories(lib) | ||
include_directories(modules/openvr/headers) | ||
|
||
add_library( gl3w lib/gl3w/src/gl3w.c ) | ||
|
||
#configure_file(LinixConfig.h.in LinuxConfig.h) | ||
|
||
set(CMAKE_CXX_STANDARD 14) | ||
set(CMAKE_CXX_STANDARD_REQUIRED True) | ||
|
||
add_executable(OpenVR-SpaceCalibrator | ||
OpenVR-SpaceCalibrator/OpenVR-SpaceCalibrator.cpp | ||
OpenVR-SpaceCalibrator/Calibration.cpp | ||
OpenVR-SpaceCalibrator/Configuration.cpp | ||
OpenVR-SpaceCalibrator/EmbeddedFiles.cpp | ||
OpenVR-SpaceCalibrator/IPCClient.cpp | ||
OpenVR-SpaceCalibrator/OpenVR-SpaceCalibrator.cpp | ||
OpenVR-SpaceCalibrator/UserInterface.cpp | ||
OpenVR-SpaceCalibrator/stdafx.cpp | ||
./OpenVR-SpaceCalibratorDriver/compat.cpp | ||
./OpenVR-SpaceCalibratorDriver/Logging.cpp | ||
) | ||
TARGET_LINK_LIBRARIES(OpenVR-SpaceCalibrator PRIVATE openvr_api imgui gl3w GL glfw) | ||
|
||
add_library( | ||
driver_01spacecalibrator | ||
SHARED | ||
OpenVR-SpaceCalibratorDriver/OpenVR-SpaceCalibratorDriver.cpp | ||
OpenVR-SpaceCalibratorDriver/Hooking.cpp | ||
OpenVR-SpaceCalibratorDriver/IPCServer.cpp | ||
OpenVR-SpaceCalibratorDriver/InterfaceHookInjector.cpp | ||
OpenVR-SpaceCalibratorDriver/Logging.cpp | ||
OpenVR-SpaceCalibratorDriver/ServerTrackedDeviceProvider.cpp | ||
OpenVR-SpaceCalibratorDriver/compat.cpp | ||
OpenVR-SpaceCalibratorDriver/dllmain.cpp | ||
) | ||
|
||
set_target_properties(driver_01spacecalibrator PROPERTIES | ||
OUTPUT_NAME driver_01spacecalibrator | ||
PREFIX "" | ||
) | ||
|
||
####################################################################################### | ||
set( APP_MANIFEST_PATH ${CMAKE_INSTALL_PREFIX}/share/openvr-spacecalibrator/manifest.vrmanifest ) | ||
set( DRIVER_INSTALLER_PATH ${CMAKE_INSTALL_PREFIX}/share/openvr-spacecalibrator ) | ||
set( DRIVER_MANIFEST_PATH ${CMAKE_INSTALL_PREFIX}/lib/steamvr/OpenVR-SpaceCalibrator/01spacecalibrator ) | ||
configure_file( StaticConfig.h.in StaticConfig.h ) | ||
|
||
include_directories("${CMAKE_CURRENT_BINARY_DIR}") | ||
|
||
configure_file( ./OpenVR-SpaceCalibrator/manifest.vrmanifest ${CMAKE_CURRENT_BINARY_DIR}/manifest.vrmanifest ) | ||
configure_file( ./OpenVR-SpaceCalibratorDriver/01spacecalibrator/driver.vrdrivermanifest ${CMAKE_CURRENT_BINARY_DIR}/driver.vrdrivermanifest ) | ||
configure_file( ./driverInstall.py ${CMAKE_CURRENT_BINARY_DIR}/driverInstall.py ) | ||
|
||
|
||
####################################################################################### | ||
install( | ||
FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.vrmanifest | ||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/openvr-spacecalibrator | ||
) | ||
|
||
install( | ||
FILES ${CMAKE_CURRENT_BINARY_DIR}/driver.vrdrivermanifest | ||
DESTINATION lib/steamvr/OpenVR-SpaceCalibrator/01spacecalibrator | ||
) | ||
|
||
install( | ||
TARGETS OpenVR-SpaceCalibrator | ||
) | ||
install( | ||
TARGETS driver_01spacecalibrator | ||
DESTINATION lib/steamvr/OpenVR-SpaceCalibrator/01spacecalibrator/bin/linux64/ | ||
) | ||
|
||
install( | ||
FILES driverInstall.py | ||
DESTINATION "${DRIVER_INSTALLER_PATH}" | ||
) | ||
|
||
find_package(Git QUIET) | ||
|
||
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") | ||
# Update submodules as needed | ||
option(GIT_SUBMODULE "Check submodules during build" ON) | ||
if(GIT_SUBMODULE) | ||
message(STATUS "Submodule update") | ||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
RESULT_VARIABLE GIT_SUBMOD_RESULT) | ||
if(NOT GIT_SUBMOD_RESULT EQUAL "0") | ||
message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") | ||
endif() | ||
endif() | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be a bit worried that the use of
#ifdef
scattered about the codebase will create maintenance problems in the future. Usually the way this is approached in larger codebases would be to refactor out the code that needs to differ into its own function, then have a set of windows-specific or linux-specific .cpp files. Having it scattered everywhere makes it hard to see what differs between the platforms, and because the surface area that differs is so ad-hoc, it makes it too easy to forget to carry across a change between the two variants.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can swap things over to that. I can see how it would be a better solution.