CMakeLists.txt 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. settings.cpp
  13. settings.h
  14. touch_from_button.cpp
  15. touch_from_button.h
  16. gcadapter/gc_adapter.cpp
  17. gcadapter/gc_adapter.h
  18. gcadapter/gc_poller.cpp
  19. gcadapter/gc_poller.h
  20. mouse/mouse_input.cpp
  21. mouse/mouse_input.h
  22. mouse/mouse_poller.cpp
  23. mouse/mouse_poller.h
  24. sdl/sdl.cpp
  25. sdl/sdl.h
  26. udp/client.cpp
  27. udp/client.h
  28. udp/protocol.cpp
  29. udp/protocol.h
  30. udp/udp.cpp
  31. udp/udp.h
  32. )
  33. if (MSVC)
  34. target_compile_options(input_common PRIVATE
  35. /W4
  36. /WX
  37. # 'expression' : signed/unsigned mismatch
  38. /we4018
  39. # 'argument' : conversion from 'type1' to 'type2', possible loss of data (floating-point)
  40. /we4244
  41. # 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch
  42. /we4245
  43. # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
  44. /we4254
  45. # 'var' : conversion from 'size_t' to 'type', possible loss of data
  46. /we4267
  47. # 'context' : truncation from 'type1' to 'type2'
  48. /we4305
  49. )
  50. else()
  51. target_compile_options(input_common PRIVATE
  52. -Werror
  53. -Werror=conversion
  54. -Werror=ignored-qualifiers
  55. -Werror=implicit-fallthrough
  56. -Werror=reorder
  57. -Werror=shadow
  58. -Werror=sign-compare
  59. $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>
  60. $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable>
  61. -Werror=unused-variable
  62. )
  63. endif()
  64. if(SDL2_FOUND)
  65. target_sources(input_common PRIVATE
  66. sdl/sdl_impl.cpp
  67. sdl/sdl_impl.h
  68. )
  69. target_link_libraries(input_common PRIVATE SDL2)
  70. target_compile_definitions(input_common PRIVATE HAVE_SDL2)
  71. endif()
  72. target_include_directories(input_common SYSTEM PRIVATE ${LIBUSB_INCLUDE_DIR})
  73. target_link_libraries(input_common PRIVATE ${LIBUSB_LIBRARIES})
  74. create_target_directory_groups(input_common)
  75. target_link_libraries(input_common PUBLIC core PRIVATE common Boost::boost)