CMakeLists.txt 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. # SPDX-FileCopyrightText: 2018 yuzu Emulator Project
  2. # SPDX-License-Identifier: GPL-2.0-or-later
  3. add_library(input_common STATIC
  4. drivers/camera.cpp
  5. drivers/camera.h
  6. drivers/keyboard.cpp
  7. drivers/keyboard.h
  8. drivers/mouse.cpp
  9. drivers/mouse.h
  10. drivers/tas_input.cpp
  11. drivers/tas_input.h
  12. drivers/touch_screen.cpp
  13. drivers/touch_screen.h
  14. drivers/udp_client.cpp
  15. drivers/udp_client.h
  16. drivers/virtual_amiibo.cpp
  17. drivers/virtual_amiibo.h
  18. drivers/virtual_gamepad.cpp
  19. drivers/virtual_gamepad.h
  20. helpers/stick_from_buttons.cpp
  21. helpers/stick_from_buttons.h
  22. helpers/touch_from_buttons.cpp
  23. helpers/touch_from_buttons.h
  24. helpers/udp_protocol.cpp
  25. helpers/udp_protocol.h
  26. input_engine.cpp
  27. input_engine.h
  28. input_mapping.cpp
  29. input_mapping.h
  30. input_poller.cpp
  31. input_poller.h
  32. main.cpp
  33. main.h
  34. precompiled_headers.h
  35. )
  36. if (MSVC)
  37. target_compile_options(input_common PRIVATE
  38. /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
  39. /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
  40. /we4800 # Implicit conversion from 'type' to bool. Possible information loss
  41. )
  42. else()
  43. target_compile_options(input_common PRIVATE
  44. -Werror=conversion
  45. )
  46. endif()
  47. if (ENABLE_SDL2)
  48. target_sources(input_common PRIVATE
  49. drivers/joycon.cpp
  50. drivers/joycon.h
  51. drivers/sdl_driver.cpp
  52. drivers/sdl_driver.h
  53. helpers/joycon_driver.cpp
  54. helpers/joycon_driver.h
  55. helpers/joycon_protocol/calibration.cpp
  56. helpers/joycon_protocol/calibration.h
  57. helpers/joycon_protocol/common_protocol.cpp
  58. helpers/joycon_protocol/common_protocol.h
  59. helpers/joycon_protocol/generic_functions.cpp
  60. helpers/joycon_protocol/generic_functions.h
  61. helpers/joycon_protocol/joycon_types.h
  62. helpers/joycon_protocol/irs.cpp
  63. helpers/joycon_protocol/irs.h
  64. helpers/joycon_protocol/nfc.cpp
  65. helpers/joycon_protocol/nfc.h
  66. helpers/joycon_protocol/poller.cpp
  67. helpers/joycon_protocol/poller.h
  68. helpers/joycon_protocol/ringcon.cpp
  69. helpers/joycon_protocol/ringcon.h
  70. helpers/joycon_protocol/rumble.cpp
  71. helpers/joycon_protocol/rumble.h
  72. )
  73. target_link_libraries(input_common PRIVATE SDL2::SDL2)
  74. target_compile_definitions(input_common PRIVATE HAVE_SDL2)
  75. endif()
  76. if (ENABLE_LIBUSB)
  77. target_sources(input_common PRIVATE
  78. drivers/gc_adapter.cpp
  79. drivers/gc_adapter.h
  80. )
  81. target_link_libraries(input_common PRIVATE libusb::usb)
  82. target_compile_definitions(input_common PRIVATE HAVE_LIBUSB)
  83. endif()
  84. create_target_directory_groups(input_common)
  85. target_link_libraries(input_common PUBLIC core PRIVATE common Boost::headers)
  86. if (YUZU_USE_PRECOMPILED_HEADERS)
  87. target_precompile_headers(input_common PRIVATE precompiled_headers.h)
  88. endif()