CMakeLists.txt 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. add_library(kitchen_sink_libs INTERFACE)
  2. target_sources(kitchen_sink_libs INTERFACE
  3. ${CMAKE_CURRENT_LIST_DIR}/kitchen_sink.c
  4. )
  5. target_link_libraries(kitchen_sink_libs INTERFACE
  6. hardware_adc
  7. hardware_clocks
  8. hardware_divider
  9. hardware_dma
  10. hardware_flash
  11. hardware_gpio
  12. hardware_i2c
  13. hardware_interp
  14. hardware_irq
  15. hardware_pio
  16. hardware_pll
  17. hardware_pwm
  18. hardware_resets
  19. hardware_rtc
  20. hardware_uart
  21. hardware_spi
  22. hardware_sync
  23. hardware_timer
  24. hardware_uart
  25. hardware_vreg
  26. hardware_watchdog
  27. hardware_xosc
  28. pico_bit_ops
  29. pico_bootrom
  30. pico_divider
  31. pico_double
  32. pico_fix_rp2040_usb_device_enumeration
  33. pico_float
  34. pico_int64_ops
  35. pico_malloc
  36. pico_mem_ops
  37. pico_multicore
  38. pico_platform
  39. pico_stdlib
  40. pico_sync
  41. pico_time
  42. pico_util
  43. )
  44. add_library(kitchen_sink_options INTERFACE)
  45. target_compile_options(kitchen_sink_options INTERFACE
  46. -Werror
  47. -Wall
  48. -Wextra
  49. -Wno-unused-parameter
  50. -Wno-inline
  51. -Wnull-dereference
  52. # -pedantic
  53. -Wall
  54. -Wcast-qual
  55. -Wno-deprecated-declarations
  56. -Wfloat-equal
  57. -Wmissing-format-attribute
  58. -Wno-long-long
  59. # todo not sure these are true, but investigate
  60. #-Wpacked
  61. # todo we have some of these in usb_device_tiny to try to make it more readable.. perhaps doxygen would help here instead
  62. #-Wredundant-decls
  63. -Wno-shadow
  64. -Wno-missing-field-initializers
  65. -Wno-missing-braces
  66. -Wno-sign-compare
  67. -Wno-multichar
  68. # todo useful but fix later
  69. #-Wundef
  70. )
  71. target_compile_definitions(kitchen_sink_libs INTERFACE
  72. NDEBUG
  73. PICO_AUDIO_DMA_IRQ=1
  74. )
  75. add_executable(kitchen_sink)
  76. target_link_libraries(kitchen_sink kitchen_sink_libs kitchen_sink_options)
  77. pico_set_program_name(kitchen_sink "Wombat tenticles")
  78. pico_add_extra_outputs(kitchen_sink)
  79. add_executable(kitchen_sink_extra_stdio)
  80. target_link_libraries(kitchen_sink_extra_stdio kitchen_sink_libs) # no kitchen_sink_options as TinyUSB has warnings
  81. pico_add_extra_outputs(kitchen_sink_extra_stdio)
  82. pico_enable_stdio_usb(kitchen_sink_extra_stdio 1)
  83. pico_enable_stdio_semihosting(kitchen_sink_extra_stdio 1)
  84. add_executable(kitchen_sink_copy_to_ram)
  85. pico_set_binary_type(kitchen_sink_copy_to_ram copy_to_ram)
  86. target_link_libraries(kitchen_sink_copy_to_ram kitchen_sink_libs kitchen_sink_options)
  87. pico_add_extra_outputs(kitchen_sink_copy_to_ram)
  88. add_executable(kitchen_sink_no_flash)
  89. pico_set_binary_type(kitchen_sink_no_flash no_flash)
  90. target_link_libraries(kitchen_sink_no_flash kitchen_sink_libs kitchen_sink_options)
  91. pico_add_extra_outputs(kitchen_sink_no_flash)