diff --git a/components/freertos/CMakeLists.txt b/components/freertos/CMakeLists.txt index b62e1125967..78a8e4ae4ef 100644 --- a/components/freertos/CMakeLists.txt +++ b/components/freertos/CMakeLists.txt @@ -140,7 +140,12 @@ idf_component_register(SRCS "${srcs}" PRIV_REQUIRES soc esp_pm) idf_component_get_property(COMPONENT_DIR freertos COMPONENT_DIR) -idf_component_set_property(freertos ORIG_INCLUDE_PATH "${COMPONENT_DIR}/include/freertos/") + +if(CONFIG_FREERTOS_SMP) + idf_component_set_property(freertos ORIG_INCLUDE_PATH "${COMPONENT_DIR}/FreeRTOS-Kernel-SMP/include/freertos/") +else() + idf_component_set_property(freertos ORIG_INCLUDE_PATH "${COMPONENT_DIR}/FreeRTOS-Kernel/include/freertos/") +endif() if(CONFIG_FREERTOS_DEBUG_OCDAWARE) target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=uxTopUsedPriority") #will be removed diff --git a/components/freertos/test_apps/.build-test-rules.yml b/components/freertos/test_apps/.build-test-rules.yml new file mode 100644 index 00000000000..8a0214c0a6f --- /dev/null +++ b/components/freertos/test_apps/.build-test-rules.yml @@ -0,0 +1,6 @@ +# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps + +components/freertos/test_apps/orig_inc_path: + enable: + - if: IDF_TARGET in ["esp32"] + reason: The feature only depends on the build system, nothing target-specific that needs to be tested diff --git a/components/freertos/test_apps/orig_inc_path/CMakeLists.txt b/components/freertos/test_apps/orig_inc_path/CMakeLists.txt new file mode 100644 index 00000000000..1ddfb866ada --- /dev/null +++ b/components/freertos/test_apps/orig_inc_path/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(test_freertos_orig_inc_path) diff --git a/components/freertos/test_apps/orig_inc_path/README.md b/components/freertos/test_apps/orig_inc_path/README.md new file mode 100644 index 00000000000..f708a1985a3 --- /dev/null +++ b/components/freertos/test_apps/orig_inc_path/README.md @@ -0,0 +1,2 @@ +| Supported Targets | ESP32 | +| ----------------- | ----- | diff --git a/components/freertos/test_apps/orig_inc_path/main/CMakeLists.txt b/components/freertos/test_apps/orig_inc_path/main/CMakeLists.txt new file mode 100644 index 00000000000..5b80b256eef --- /dev/null +++ b/components/freertos/test_apps/orig_inc_path/main/CMakeLists.txt @@ -0,0 +1,6 @@ +idf_component_register(SRCS "test_main.c" + INCLUDE_DIRS ".") + +# Update include path to not include the directory, i.e. "task.h" instead of "freertos/task.h" +idf_component_get_property(FREERTOS_ORIG_INCLUDE_PATH freertos ORIG_INCLUDE_PATH) +target_include_directories(${COMPONENT_TARGET} PRIVATE "${FREERTOS_ORIG_INCLUDE_PATH}") diff --git a/components/freertos/test_apps/orig_inc_path/main/test_main.c b/components/freertos/test_apps/orig_inc_path/main/test_main.c new file mode 100644 index 00000000000..a597b1b3b84 --- /dev/null +++ b/components/freertos/test_apps/orig_inc_path/main/test_main.c @@ -0,0 +1,13 @@ +/* + * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* Check that freeRTOS headers can be included without the 'freertos/' directory path prefix */ +#include "FreeRTOS.h" +#include "task.h" + +void app_main(void) +{ +} diff --git a/components/freertos/test_apps/orig_inc_path/sdkconfig.ci.default b/components/freertos/test_apps/orig_inc_path/sdkconfig.ci.default new file mode 100644 index 00000000000..e69de29bb2d diff --git a/components/freertos/test_apps/orig_inc_path/sdkconfig.ci.freertos_smp b/components/freertos/test_apps/orig_inc_path/sdkconfig.ci.freertos_smp new file mode 100644 index 00000000000..08f988b14ae --- /dev/null +++ b/components/freertos/test_apps/orig_inc_path/sdkconfig.ci.freertos_smp @@ -0,0 +1 @@ +CONFIG_FREERTOS_SMP=y