mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-07 06:34:34 +02:00
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:
@@ -363,3 +363,10 @@ test_cxx_gpio:
|
|||||||
- cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/gpio
|
- cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/gpio
|
||||||
- idf.py build
|
- idf.py build
|
||||||
- build/test_gpio_cxx_host.elf
|
- 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
|
||||||
|
@@ -2,4 +2,9 @@ cmake_minimum_required(VERSION 3.5)
|
|||||||
|
|
||||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||||
set(COMPONENTS main)
|
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)
|
project(linux_host_app)
|
||||||
|
@@ -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.
|
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).
|
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.
|
Otherwise, a lot of hardware-dependent code would be pulled in.
|
||||||
|
|
||||||
|
# Requirements
|
||||||
|
Currently, Ruby is required for the mock override of FreeRTOS.
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
Source the IDF environment as usual, then set the Linux target:
|
Source the IDF environment as usual, then set the Linux target:
|
||||||
```bash
|
```bash
|
||||||
|
@@ -1,2 +1,3 @@
|
|||||||
|
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=n
|
||||||
CONFIG_IDF_TARGET="linux"
|
CONFIG_IDF_TARGET="linux"
|
||||||
CONFIG_COMPILER_CXX_EXCEPTIONS=y
|
CONFIG_COMPILER_CXX_EXCEPTIONS=y
|
||||||
|
Reference in New Issue
Block a user