jkuhlmann / gainput

Cross-platform C++ input library supporting gamepads, keyboard, mouse, touch
http://gainput.johanneskuhlmann.de/
MIT License
858 stars 104 forks source link

Build gainput as a shared library by using BUILD_SHARED option in CMake. #79

Open jpvanoosten opened 4 years ago

jpvanoosten commented 4 years ago

As mentioned in issue #78, it is not possible to generate the project in CMake if either GAIN_BUILD_SHARED or GAIN_BUILD_STATIC is disabled while generating the project. This pull request fixes this issue by relying on the BUILD_SHARED_LIBS built-in option in CMake. The gainputstatic project should not be necessary if we rely on the fact that the user can switch between the shared and static variants by specifying the BUILD_SHARED_LIBS option accordingly.

jpvanoosten commented 4 years ago

The 2nd commit also fixes up CMake configurations to provide the public include files and library dependencies required by targets that consume gainput.

Also fixed a lot of compiler errors/warnings.

Also removed failing test cases on Windows when using XInput (PadButtonAxis19 and PadButtonGyroscopeY) are not valid pad buttons when using XInput.