CMakeLists.txt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. udp/client.cpp
  25. udp/client.h
  26. udp/protocol.cpp
  27. udp/protocol.h
  28. udp/udp.cpp
  29. udp/udp.h
  30. )
  31. if (MSVC)
  32. target_compile_options(input_common PRIVATE
  33. /W4
  34. /WX
  35. /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
  36. /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data
  37. /we4245 # 'conversion': conversion from 'type1' to 'type2', signed/unsigned mismatch
  38. /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
  39. )
  40. else()
  41. target_compile_options(input_common PRIVATE
  42. -Werror
  43. -Werror=conversion
  44. -Werror=ignored-qualifiers
  45. -Werror=shadow
  46. $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>
  47. $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable>
  48. -Werror=unused-variable
  49. )
  50. endif()
  51. if (ENABLE_SDL2)
  52. target_sources(input_common PRIVATE
  53. sdl/sdl_impl.cpp
  54. sdl/sdl_impl.h
  55. )
  56. target_link_libraries(input_common PRIVATE SDL2)
  57. target_compile_definitions(input_common PRIVATE HAVE_SDL2)
  58. endif()
  59. target_link_libraries(input_common PRIVATE usb)
  60. create_target_directory_groups(input_common)
  61. target_link_libraries(input_common PUBLIC core PRIVATE common Boost::boost)