CMakeLists.txt 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. # 'expression' : signed/unsigned mismatch
  36. /we4018
  37. # 'argument' : conversion from 'type1' to 'type2', possible loss of data (floating-point)
  38. /we4244
  39. # 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch
  40. /we4245
  41. # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
  42. /we4254
  43. # 'var' : conversion from 'size_t' to 'type', possible loss of data
  44. /we4267
  45. # 'context' : truncation from 'type1' to 'type2'
  46. /we4305
  47. )
  48. else()
  49. target_compile_options(input_common PRIVATE
  50. -Werror
  51. -Werror=conversion
  52. -Werror=ignored-qualifiers
  53. -Werror=implicit-fallthrough
  54. -Werror=reorder
  55. -Werror=shadow
  56. -Werror=sign-compare
  57. $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>
  58. $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable>
  59. -Werror=unused-variable
  60. )
  61. endif()
  62. if (ENABLE_SDL2)
  63. target_sources(input_common PRIVATE
  64. sdl/sdl_impl.cpp
  65. sdl/sdl_impl.h
  66. )
  67. target_link_libraries(input_common PRIVATE SDL2)
  68. target_compile_definitions(input_common PRIVATE HAVE_SDL2)
  69. endif()
  70. target_include_directories(input_common SYSTEM PRIVATE ${LIBUSB_INCLUDE_DIR})
  71. target_link_libraries(input_common PRIVATE ${LIBUSB_LIBRARIES})
  72. create_target_directory_groups(input_common)
  73. target_link_libraries(input_common PUBLIC core PRIVATE common Boost::boost)