CMakeLists.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. /W4
  39. /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
  40. /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
  41. /we4800 # Implicit conversion from 'type' to bool. Possible information loss
  42. )
  43. else()
  44. target_compile_options(input_common PRIVATE
  45. -Werror=conversion
  46. )
  47. endif()
  48. if (ENABLE_SDL2)
  49. target_sources(input_common PRIVATE
  50. drivers/joycon.cpp
  51. drivers/joycon.h
  52. drivers/sdl_driver.cpp
  53. drivers/sdl_driver.h
  54. helpers/joycon_driver.cpp
  55. helpers/joycon_driver.h
  56. helpers/joycon_protocol/calibration.cpp
  57. helpers/joycon_protocol/calibration.h
  58. helpers/joycon_protocol/common_protocol.cpp
  59. helpers/joycon_protocol/common_protocol.h
  60. helpers/joycon_protocol/generic_functions.cpp
  61. helpers/joycon_protocol/generic_functions.h
  62. helpers/joycon_protocol/joycon_types.h
  63. helpers/joycon_protocol/irs.cpp
  64. helpers/joycon_protocol/irs.h
  65. helpers/joycon_protocol/nfc.cpp
  66. helpers/joycon_protocol/nfc.h
  67. helpers/joycon_protocol/poller.cpp
  68. helpers/joycon_protocol/poller.h
  69. helpers/joycon_protocol/ringcon.cpp
  70. helpers/joycon_protocol/ringcon.h
  71. helpers/joycon_protocol/rumble.cpp
  72. helpers/joycon_protocol/rumble.h
  73. )
  74. target_link_libraries(input_common PRIVATE SDL2::SDL2)
  75. target_compile_definitions(input_common PRIVATE HAVE_SDL2)
  76. endif()
  77. if (ENABLE_LIBUSB)
  78. target_sources(input_common PRIVATE
  79. drivers/gc_adapter.cpp
  80. drivers/gc_adapter.h
  81. )
  82. target_link_libraries(input_common PRIVATE libusb::usb)
  83. target_compile_definitions(input_common PRIVATE HAVE_LIBUSB)
  84. endif()
  85. create_target_directory_groups(input_common)
  86. target_link_libraries(input_common PUBLIC core PRIVATE common Boost::headers)
  87. if (YUZU_USE_PRECOMPILED_HEADERS)
  88. target_precompile_headers(input_common PRIVATE precompiled_headers.h)
  89. endif()