CMakeLists.txt 2.0 KB

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