CMakeLists.txt 1.9 KB

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