Skip to content

fix(build): Fix cmake warning about freertos component dependency#77

Merged
peter-marcisovsky merged 1 commit intorelease/v0.20from
fix/cmake_warnings_freertos_include
Apr 13, 2026
Merged

fix(build): Fix cmake warning about freertos component dependency#77
peter-marcisovsky merged 1 commit intorelease/v0.20from
fix/cmake_warnings_freertos_include

Conversation

@peter-marcisovsky
Copy link
Copy Markdown
Collaborator

@peter-marcisovsky peter-marcisovsky commented Apr 7, 2026

Description

Removing CMake warning:

CMake Warning at /home/peter/esp/esp-idf/tools/cmake/component_validation.cmake:86 (message):
  Include directory
  '/home/peter/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos'
  belongs to component freertos but is being used by component tinyusb.  It
  is recommended to define the component dependency for 'tinyusb' on the
  component freertos, i.e.  'idf_component_register(...  REQUIRES freertos)'
  in the CMakeLists.txt of tinyusb, and specify the included directory as
  idf_component_register(...  INCLUDE_DIRS <dir relative to component>) in
  the CMakeLists.txt of component freertos.
Call Stack (most recent call first):
  /home/peter/esp/esp-idf/tools/cmake/component_validation.cmake:130 (__component_validation_check_include_dirs)
  /home/peter/esp/esp-idf/CMakeLists.txt:353 (__component_validation_run_checks)
  • TinyUSB's CMake adds FreeRTOS's private include path via ORIG_INCLUDE_PATH instead of declaring a component dependency.
  • ESP-IDF's TinyUSB port uses CFG_TUSB_OS_INC_PATH_DEFAULT of freertos/, so freertos/FreeRTOS.h resolves through the freertos component's public INCLUDE_DIRS.
  • Removing the duplicate path and adding REQUIRES freertos

Related

@peter-marcisovsky peter-marcisovsky force-pushed the fix/cmake_warnings_freertos_include branch from 880685f to 3d5c3da Compare April 10, 2026 14:06
@peter-marcisovsky peter-marcisovsky added the BUILD_AND_TEST_EXTERNAL_EXAMPLES Build and run esp-idf examples label Apr 10, 2026
@peter-marcisovsky peter-marcisovsky force-pushed the fix/cmake_warnings_freertos_include branch from c7fba22 to 3d5c3da Compare April 10, 2026 17:05
@peter-marcisovsky peter-marcisovsky marked this pull request as ready for review April 10, 2026 17:05
Copy link
Copy Markdown
Collaborator

@tore-espressif tore-espressif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the original code allowed us to include FreeRTOS headers with simple #include "queue.h" but esp-idf used #include "freertos/queue.h".

But now it is all fixed in TinyUSB upstream code, so this fix should work OK
eg. https://github.com/hathach/tinyusb/blob/3cfe7a0ed1c8c0ca7b1ad747cfce502a5312bf1c/examples/device/hid_composite_freertos/src/main.c#L34-L50

@peter-marcisovsky peter-marcisovsky merged commit bb1ed9c into release/v0.20 Apr 13, 2026
78 of 79 checks passed
@peter-marcisovsky peter-marcisovsky deleted the fix/cmake_warnings_freertos_include branch April 13, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants