Merge branch 'bugfix/fix_linux_host_example' into 'master'

[examples]: fixed linux host example

See merge request espressif/esp-idf!15154
This commit is contained in:
Zim Kalinowski 2021-09-15 22:04:07 +00:00
commit 7bd62b660d
4 changed files with 17 additions and 1 deletions

View File

@ -363,3 +363,10 @@ test_cxx_gpio:
- cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/gpio
- idf.py build
- build/test_gpio_cxx_host.elf
test_linux_example:
extends: .host_test_template
script:
- cd ${IDF_PATH}/examples/build_system/cmake/linux_host_app
- idf.py build
- build/linux_host_app.elf

View File

@ -2,4 +2,9 @@ cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(COMPONENTS main)
# Freertos is included via common components, however, currently only the mock component is compatible with linux
# target.
list(APPEND EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/mocks/freertos/")
project(linux_host_app)

View File

@ -13,9 +13,12 @@ There are two major differences to an IDF application built for an ESP chip comp
2. The project-level [CMakeLists.txt](CMakeLists.txt) for Linux is different from that of a normal IDF application for an ESP chip.
On Linux, there is an additional line `set(COMPONENTS main)`, which clears the common requirements (default dependencies usually included in all IDF applications).
This is currently necessary as the Linux-host feature is still under developement.
This is currently necessary as the Linux-host feature is still under development.
Otherwise, a lot of hardware-dependent code would be pulled in.
# Requirements
Currently, Ruby is required for the mock override of FreeRTOS.
# Build
Source the IDF environment as usual, then set the Linux target:
```bash

View File

@ -1,2 +1,3 @@
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=n
CONFIG_IDF_TARGET="linux"
CONFIG_COMPILER_CXX_EXCEPTIONS=y