CMakeLists.txt 1.9 KB

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