build: minor refactoring and fixes

- Fix target_precompile_headers() usage; the CemuCommon target exposes
  the src/Common/precompiled.h precompiled header as part of its public
  interface with
  target_precompile_headers(CemuCommon PUBLIC precompiled.h), so all the
  other targets wanting to use the precompiled header have to link to
  the CemuCommon target with
  target_precompile_headers(TargetName PRIVATE CemuCommon).
- Set the project version to 2.0
- Set RUNTIME_OUTPUT_DIRECTORY instead of only their _DEBUG and _RELEASE
  variants, fixing the compilation when neither build types are defined
- Use a consistent indentation style (tabs, like in the .cpp files)
- Use "modern" variants of some functions, e.g. add_definitions ->
  add_compile_definitions
This commit is contained in:
Andrea Pappacoda 2022-09-01 14:46:56 +02:00
parent b1e92f1779
commit 719ee90b27
No known key found for this signature in database
GPG key ID: 4A9208A2455077A7
13 changed files with 208 additions and 235 deletions

View file

@ -1,98 +1,96 @@
project(CemuInput)
add_library(CemuInput
InputManager.cpp
InputManager.h
ControllerFactory.cpp
ControllerFactory.h
api/ControllerState.h
api/Controller.cpp
api/Controller.h
api/ControllerState.cpp
api/InputAPI.h
api/ControllerProvider.h
emulated/ProController.cpp
emulated/EmulatedController.h
emulated/EmulatedController.cpp
emulated/ProController.h
emulated/WPADController.cpp
emulated/WPADController.h
emulated/WiimoteController.h
emulated/VPADController.cpp
emulated/WiimoteController.cpp
emulated/VPADController.h
emulated/ClassicController.cpp
emulated/ClassicController.h
InputManager.cpp
InputManager.h
ControllerFactory.cpp
ControllerFactory.h
api/ControllerState.h
api/Controller.cpp
api/Controller.h
api/ControllerState.cpp
api/InputAPI.h
api/ControllerProvider.h
emulated/ProController.cpp
emulated/EmulatedController.h
emulated/EmulatedController.cpp
emulated/ProController.h
emulated/WPADController.cpp
emulated/WPADController.h
emulated/WiimoteController.h
emulated/VPADController.cpp
emulated/WiimoteController.cpp
emulated/VPADController.h
emulated/ClassicController.cpp
emulated/ClassicController.h
)
set_property(TARGET CemuInput PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
# SDL
target_sources(CemuInput PRIVATE
api/SDL/SDLController.cpp
api/SDL/SDLControllerProvider.cpp
api/SDL/SDLController.h
api/SDL/SDLControllerProvider.h
api/SDL/SDLController.cpp
api/SDL/SDLControllerProvider.cpp
api/SDL/SDLController.h
api/SDL/SDLControllerProvider.h
)
# DSU
target_sources(CemuInput PRIVATE
api/DSU/DSUController.h
api/DSU/DSUControllerProvider.cpp
api/DSU/DSUController.cpp
api/DSU/DSUControllerProvider.h
api/DSU/DSUMessages.h
api/DSU/DSUMessages.cpp
api/DSU/DSUController.h
api/DSU/DSUControllerProvider.cpp
api/DSU/DSUController.cpp
api/DSU/DSUControllerProvider.h
api/DSU/DSUMessages.h
api/DSU/DSUMessages.cpp
)
# Keyboard controller
target_sources(CemuInput PRIVATE
api/Keyboard/KeyboardControllerProvider.h
api/Keyboard/KeyboardControllerProvider.cpp
api/Keyboard/KeyboardController.cpp
api/Keyboard/KeyboardController.h
api/Keyboard/KeyboardControllerProvider.h
api/Keyboard/KeyboardControllerProvider.cpp
api/Keyboard/KeyboardController.cpp
api/Keyboard/KeyboardController.h
)
# Native gamecube
target_sources(CemuInput PRIVATE
api/GameCube/GameCubeController.cpp
api/GameCube/GameCubeControllerProvider.h
api/GameCube/GameCubeControllerProvider.cpp
api/GameCube/GameCubeController.h
api/GameCube/GameCubeController.cpp
api/GameCube/GameCubeControllerProvider.h
api/GameCube/GameCubeControllerProvider.cpp
api/GameCube/GameCubeController.h
)
if(WIN32)
# Native wiimote (Win32 only for now)
target_sources(CemuInput PRIVATE
api/Wiimote/WiimoteControllerProvider.h
api/Wiimote/windows/WinWiimoteDevice.cpp
api/Wiimote/windows/WinWiimoteDevice.h
api/Wiimote/WiimoteControllerProvider.cpp
api/Wiimote/WiimoteMessages.h
api/Wiimote/NativeWiimoteController.h
api/Wiimote/NativeWiimoteController.cpp
api/Wiimote/WiimoteDevice.h
)
# Native wiimote (Win32 only for now)
target_sources(CemuInput PRIVATE
api/Wiimote/WiimoteControllerProvider.h
api/Wiimote/windows/WinWiimoteDevice.cpp
api/Wiimote/windows/WinWiimoteDevice.h
api/Wiimote/WiimoteControllerProvider.cpp
api/Wiimote/WiimoteMessages.h
api/Wiimote/NativeWiimoteController.h
api/Wiimote/NativeWiimoteController.cpp
api/Wiimote/WiimoteDevice.h
)
# XInput
target_sources(CemuInput PRIVATE
api/XInput/XInputControllerProvider.cpp
api/XInput/XInputControllerProvider.h
api/XInput/XInputController.cpp
api/XInput/XInputController.h
)
# XInput
target_sources(CemuInput PRIVATE
api/XInput/XInputControllerProvider.cpp
api/XInput/XInputControllerProvider.h
api/XInput/XInputController.cpp
api/XInput/XInputController.h
)
# DirectInput
target_sources(CemuInput PRIVATE
api/DirectInput/DirectInputControllerProvider.cpp
api/DirectInput/DirectInputController.h
api/DirectInput/DirectInputControllerProvider.h
api/DirectInput/DirectInputController.cpp
)
# DirectInput
target_sources(CemuInput PRIVATE
api/DirectInput/DirectInputControllerProvider.cpp
api/DirectInput/DirectInputController.h
api/DirectInput/DirectInputControllerProvider.h
api/DirectInput/DirectInputController.cpp
)
endif()
target_precompile_headers(CemuInput PRIVATE ../Common/precompiled.h)
target_include_directories(CemuInput PUBLIC "../")
target_link_libraries(CemuInput PRIVATE