tinyusb icon indicating copy to clipboard operation
tinyusb copied to clipboard

comment out example.cmake warnings which break builds of rp2040 sdk or older compilers

Open kilograham opened this issue 3 years ago • 4 comments

kilograham avatar Jun 30 '22 01:06 kilograham

Note also, that lots of code like

# Example common such as compiler warnings
include(${CMAKE_CURRENT_SOURCE_DIR}/../../example.cmake)

was added to each example CMakeLists.txt, however there was a function call in each, e.g.

# Example common such as compiler warnings
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})

which would seem like a better place to have allowed each port to specify warnings if it wanted to

kilograham avatar Jun 30 '22 02:06 kilograham

converting this to a draft as I'm not going to apply this quick fix at the moment

kilograham avatar Jun 30 '22 03:06 kilograham

which would seem like a better place to have allowed each port to specify warnings if it wanted to

Yeah, I agree, it is a better place to add warnings. Though since family.cmake is also used by pico-sdk for and I am not sure if the family_configure_device_example/family_configure_host_example() function are used by other sdk examples and/or user projects. I play a bit safe by only introducing these warnings to tinyusb's examples only, we can refactor this later on.

hathach avatar Jun 30 '22 05:06 hathach

Update: when build with LOG eanbled e.g make BOARD=raspberry_pi_pico LOG=2 I got

 error: "CFG_TUSB_DEBUG" redefined [-Werror]

due to the macro are defined in 2 places

  • https://github.com/hathach/tinyusb/blob/19956f070d4dbf75b7fe4e8108e20837a70007f4/hw/bsp/rp2040/family.cmake#L58
  • https://github.com/hathach/tinyusb/blob/19956f070d4dbf75b7fe4e8108e20837a70007f4/hw/bsp/rp2040/family.cmake#L122

hathach avatar Jun 30 '22 08:06 hathach

should we close this now ?

hathach avatar Mar 28 '23 08:03 hathach