CMakeLists.txt 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. add_library(input_common STATIC
  2. keyboard.cpp
  3. keyboard.h
  4. helpers/stick_from_buttons.cpp
  5. helpers/stick_from_buttons.h
  6. helpers/touch_from_buttons.cpp
  7. helpers/touch_from_buttons.h
  8. helpers/udp_protocol.cpp
  9. helpers/udp_protocol.h
  10. input_engine.cpp
  11. input_engine.h
  12. input_mapping.cpp
  13. input_mapping.h
  14. input_poller.cpp
  15. input_poller.h
  16. main.cpp
  17. main.h
  18. motion_from_button.cpp
  19. motion_from_button.h
  20. motion_input.cpp
  21. motion_input.h
  22. gcadapter/gc_adapter.cpp
  23. gcadapter/gc_adapter.h
  24. gcadapter/gc_poller.cpp
  25. gcadapter/gc_poller.h
  26. mouse/mouse_input.cpp
  27. mouse/mouse_input.h
  28. mouse/mouse_poller.cpp
  29. mouse/mouse_poller.h
  30. sdl/sdl.cpp
  31. sdl/sdl.h
  32. tas/tas_input.cpp
  33. tas/tas_input.h
  34. tas/tas_poller.cpp
  35. tas/tas_poller.h
  36. udp/client.cpp
  37. udp/client.h
  38. udp/udp.cpp
  39. udp/udp.h
  40. )
  41. if (MSVC)
  42. target_compile_options(input_common PRIVATE
  43. /W4
  44. /WX
  45. /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
  46. /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data
  47. /we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch
  48. /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
  49. )
  50. else()
  51. target_compile_options(input_common PRIVATE
  52. -Werror
  53. -Werror=conversion
  54. -Werror=ignored-qualifiers
  55. -Werror=shadow
  56. $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>
  57. $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable>
  58. -Werror=unused-variable
  59. )
  60. endif()
  61. if (ENABLE_SDL2)
  62. target_sources(input_common PRIVATE
  63. sdl/sdl_impl.cpp
  64. sdl/sdl_impl.h
  65. )
  66. target_link_libraries(input_common PRIVATE SDL2)
  67. target_compile_definitions(input_common PRIVATE HAVE_SDL2)
  68. endif()
  69. target_link_libraries(input_common PRIVATE usb)
  70. create_target_directory_groups(input_common)
  71. target_link_libraries(input_common PUBLIC core PRIVATE common Boost::boost)