CMakeLists.txt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. add_library(input_common STATIC
  2. drivers/gc_adapter.cpp
  3. drivers/gc_adapter.h
  4. drivers/keyboard.cpp
  5. drivers/keyboard.h
  6. drivers/mouse.cpp
  7. drivers/mouse.h
  8. drivers/sdl_driver.cpp
  9. drivers/sdl_driver.h
  10. drivers/tas_input.cpp
  11. drivers/tas_input.h
  12. drivers/touch_screen.cpp
  13. drivers/touch_screen.h
  14. drivers/udp_client.cpp
  15. drivers/udp_client.h
  16. helpers/stick_from_buttons.cpp
  17. helpers/stick_from_buttons.h
  18. helpers/touch_from_buttons.cpp
  19. helpers/touch_from_buttons.h
  20. helpers/udp_protocol.cpp
  21. helpers/udp_protocol.h
  22. input_engine.cpp
  23. input_engine.h
  24. input_mapping.cpp
  25. input_mapping.h
  26. input_poller.cpp
  27. input_poller.h
  28. main.cpp
  29. main.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. drivers/sdl_driver.cpp
  54. drivers/sdl_driver.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)