2021-07-21 12:07:53 +08:00
|
|
|
# NOTE: This kind of mocking currently works on Linux targets only.
|
|
|
|
# On Espressif chips, too many dependencies are missing at the moment.
|
2022-09-05 15:46:10 +02:00
|
|
|
message(STATUS "building FREERTOS MOCKS (only task, event-groups and queue)")
|
2021-07-21 12:07:53 +08:00
|
|
|
|
|
|
|
idf_component_get_property(original_freertos_dir freertos COMPONENT_OVERRIDEN_DIR)
|
|
|
|
|
2022-09-06 16:09:23 +02:00
|
|
|
set(kernel_dir "${original_freertos_dir}/FreeRTOS-Kernel")
|
|
|
|
|
2021-07-21 12:07:53 +08:00
|
|
|
set(include_dirs
|
2022-09-06 16:09:23 +02:00
|
|
|
"${kernel_dir}/include"
|
2023-05-08 16:37:59 +08:00
|
|
|
"${original_freertos_dir}/config/include" # For "freertos/FreeRTOSConfig.h"
|
|
|
|
"${original_freertos_dir}/config/include/freertos" # For "FreeRTOSConfig.h"
|
|
|
|
"${original_freertos_dir}/config/linux/include" # For "freertos/FreeRTOSConfig_arch.h"
|
2021-09-20 11:37:03 +05:30
|
|
|
"${original_freertos_dir}/esp_additions/include"
|
2023-08-31 22:24:06 +08:00
|
|
|
# Required because CMock tries to include "idf_additions.h" instead of "freertos/idf_additions.h"
|
|
|
|
"${original_freertos_dir}/esp_additions/include/freertos"
|
2023-10-11 11:53:03 +08:00
|
|
|
"${kernel_dir}/portable/linux/include" # For "spinlock.h"
|
|
|
|
"${kernel_dir}/portable/linux/include/freertos" # For "portmacro.h"
|
2022-09-06 16:09:23 +02:00
|
|
|
"${kernel_dir}/include/freertos" # this is due to the way includes are generated in CMock (without freertos prefix)
|
|
|
|
)
|
2021-07-21 12:07:53 +08:00
|
|
|
|
|
|
|
idf_component_mock(INCLUDE_DIRS ${include_dirs}
|
|
|
|
REQUIRES esp_common
|
|
|
|
MOCK_HEADER_FILES
|
2023-08-31 22:24:06 +08:00
|
|
|
${original_freertos_dir}/esp_additions/include/freertos/idf_additions.h
|
2021-09-20 11:37:03 +05:30
|
|
|
${original_freertos_dir}/FreeRTOS-Kernel/include/freertos/task.h
|
2022-09-05 15:46:10 +02:00
|
|
|
${original_freertos_dir}/FreeRTOS-Kernel/include/freertos/event_groups.h
|
2021-09-20 11:37:03 +05:30
|
|
|
${original_freertos_dir}/FreeRTOS-Kernel/include/freertos/queue.h)
|
2022-09-06 16:09:23 +02:00
|
|
|
|
|
|
|
idf_component_get_property(freertos_lib freertos COMPONENT_LIB)
|
|
|
|
target_compile_definitions(${freertos_lib} PUBLIC "projCOVERAGE_TEST=0")
|