diff --git a/components/esp_driver_ana_cmpr/CMakeLists.txt b/components/esp_driver_ana_cmpr/CMakeLists.txt index acc80a1f1ca..df5fd84da91 100644 --- a/components/esp_driver_ana_cmpr/CMakeLists.txt +++ b/components/esp_driver_ana_cmpr/CMakeLists.txt @@ -1,5 +1,9 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + set(srcs) # Analog comparator related source files @@ -10,15 +14,9 @@ if(CONFIG_SOC_ANA_CMPR_SUPPORTED) endif() endif() -if(${target} STREQUAL "linux") - set(priv_requires "") -else() - set(priv_requires esp_pm esp_driver_gpio) -endif() - idf_component_register(SRCS ${srcs} INCLUDE_DIRS "include" - PRIV_REQUIRES "${priv_requires}" + PRIV_REQUIRES esp_pm esp_driver_gpio REQUIRES esp_hal_ana_cmpr LDFRAGMENTS "linker.lf" ) diff --git a/components/esp_driver_cam/CMakeLists.txt b/components/esp_driver_cam/CMakeLists.txt index 425eb761721..4b2580697c9 100644 --- a/components/esp_driver_cam/CMakeLists.txt +++ b/components/esp_driver_cam/CMakeLists.txt @@ -1,5 +1,9 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + set(srcs "esp_cam_ctlr.c" "dvp_share_ctrl.c") set(includes "include" "interface") @@ -18,9 +22,7 @@ if(CONFIG_SOC_ISP_DVP_SUPPORTED) list(APPEND includes "isp_dvp/include") endif() -if(NOT ${target} STREQUAL "linux") - list(APPEND requires esp_mm) -endif() +list(APPEND requires esp_mm) if(CONFIG_SOC_LCDCAM_CAM_SUPPORTED) list(APPEND srcs "dvp/src/esp_cam_ctlr_dvp_gdma.c" "dvp/src/esp_cam_ctlr_dvp_cam.c") diff --git a/components/esp_driver_cordic/CMakeLists.txt b/components/esp_driver_cordic/CMakeLists.txt index 3d4cdf611f3..0c4f94b7e81 100644 --- a/components/esp_driver_cordic/CMakeLists.txt +++ b/components/esp_driver_cordic/CMakeLists.txt @@ -1,14 +1,14 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + set(srcs) set(public_include "include") set(requires esp_hal_cordic) -if(${target} STREQUAL "linux") - set(priv_requires "") -else() - set(priv_requires esp_pm) -endif() +set(priv_requires esp_pm) if(CONFIG_SOC_CORDIC_SUPPORTED) list(APPEND srcs diff --git a/components/esp_driver_isp/CMakeLists.txt b/components/esp_driver_isp/CMakeLists.txt index e70375f3291..7a1bc026f9b 100644 --- a/components/esp_driver_isp/CMakeLists.txt +++ b/components/esp_driver_isp/CMakeLists.txt @@ -1,5 +1,9 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + set(srcs) set(public_include "include") @@ -50,9 +54,7 @@ if(CONFIG_SOC_ISP_CROP_SUPPORTED) list(APPEND srcs "src/isp_crop.c") endif() -if(NOT ${target} STREQUAL "linux") - list(APPEND requires esp_mm) -endif() +list(APPEND requires esp_mm) idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${public_include} diff --git a/components/esp_driver_jpeg/CMakeLists.txt b/components/esp_driver_jpeg/CMakeLists.txt index 59ba4ecad30..23c6b748eda 100644 --- a/components/esp_driver_jpeg/CMakeLists.txt +++ b/components/esp_driver_jpeg/CMakeLists.txt @@ -1,5 +1,9 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + set(srcs) set(public_include "include") @@ -24,11 +28,7 @@ if(CONFIG_SOC_JPEG_CODEC_SUPPORTED) endif() set(requires esp_hal_jpeg) -if(${target} STREQUAL "linux") - set(priv_requires "") -else() - set(priv_requires esp_mm esp_pm esp_psram esp_driver_dma) -endif() +set(priv_requires esp_mm esp_pm esp_psram esp_driver_dma) idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${public_include} diff --git a/components/esp_driver_mcpwm/CMakeLists.txt b/components/esp_driver_mcpwm/CMakeLists.txt index dac9ef409af..3c3981ffade 100644 --- a/components/esp_driver_mcpwm/CMakeLists.txt +++ b/components/esp_driver_mcpwm/CMakeLists.txt @@ -1,5 +1,9 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + set(srcs) set(public_include "include") if(CONFIG_SOC_MCPWM_SUPPORTED) @@ -20,11 +24,7 @@ if(CONFIG_SOC_MCPWM_SUPPORTED) endif() set(requires esp_hal_mcpwm) -if(${target} STREQUAL "linux") - set(priv_requires "") -else() - set(priv_requires esp_pm esp_driver_gpio) -endif() +set(priv_requires esp_pm esp_driver_gpio) idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${public_include} diff --git a/components/esp_driver_parlio/CMakeLists.txt b/components/esp_driver_parlio/CMakeLists.txt index 04174045e6c..2d9c29e57f7 100644 --- a/components/esp_driver_parlio/CMakeLists.txt +++ b/components/esp_driver_parlio/CMakeLists.txt @@ -1,5 +1,9 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + set(srcs) set(public_include "include") if(CONFIG_SOC_PARLIO_SUPPORTED) @@ -17,11 +21,7 @@ if(CONFIG_SOC_PARLIO_SUPPORTED) endif() -if(${target} STREQUAL "linux") - set(priv_requires "") -else() - set(priv_requires esp_pm esp_driver_gpio esp_mm esp_driver_bitscrambler esp_driver_dma) -endif() +set(priv_requires esp_pm esp_driver_gpio esp_mm esp_driver_bitscrambler esp_driver_dma) idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${public_include} diff --git a/components/esp_driver_pcnt/CMakeLists.txt b/components/esp_driver_pcnt/CMakeLists.txt index ec9303b44fc..63f83727a6a 100644 --- a/components/esp_driver_pcnt/CMakeLists.txt +++ b/components/esp_driver_pcnt/CMakeLists.txt @@ -1,5 +1,9 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + set(srcs) set(public_include "include") if(CONFIG_SOC_PCNT_SUPPORTED) @@ -7,11 +11,7 @@ if(CONFIG_SOC_PCNT_SUPPORTED) endif() set(requires esp_hal_pcnt) -if(${target} STREQUAL "linux") - set(priv_requires "") -else() - set(priv_requires esp_pm esp_driver_gpio) -endif() +set(priv_requires esp_pm esp_driver_gpio) idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${public_include} diff --git a/components/esp_driver_ppa/CMakeLists.txt b/components/esp_driver_ppa/CMakeLists.txt index 9666d600cfd..8b3ee5dc6f1 100644 --- a/components/esp_driver_ppa/CMakeLists.txt +++ b/components/esp_driver_ppa/CMakeLists.txt @@ -1,5 +1,9 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + set(srcs) set(public_include "include") if(CONFIG_SOC_PPA_SUPPORTED) @@ -12,11 +16,7 @@ if(CONFIG_SOC_PPA_SUPPORTED) endif() endif() -if(${target} STREQUAL "linux") - set(priv_requires "") -else() - set(priv_requires esp_mm esp_pm esp_driver_dma efuse) -endif() +set(priv_requires esp_mm esp_pm esp_driver_dma efuse) idf_component_register(SRCS ${srcs} diff --git a/components/esp_driver_sdio/CMakeLists.txt b/components/esp_driver_sdio/CMakeLists.txt index 42209614119..3be90e40f86 100644 --- a/components/esp_driver_sdio/CMakeLists.txt +++ b/components/esp_driver_sdio/CMakeLists.txt @@ -1,5 +1,9 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + set(srcs) set(public_include "include") @@ -9,11 +13,7 @@ if(CONFIG_SOC_SDIO_SLAVE_SUPPORTED) list(APPEND srcs "src/sdio_slave.c") endif() -if(${target} STREQUAL "linux") - set(priv_requires esp_ringbuf) -else() - set(priv_requires esp_driver_gpio esp_ringbuf) -endif() +set(priv_requires esp_driver_gpio esp_ringbuf) idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${public_include} diff --git a/components/esp_driver_tsens/CMakeLists.txt b/components/esp_driver_tsens/CMakeLists.txt index 92e887c75f0..4d0dc8b94db 100644 --- a/components/esp_driver_tsens/CMakeLists.txt +++ b/components/esp_driver_tsens/CMakeLists.txt @@ -1,5 +1,9 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + set(srcs) set(priv_req efuse) set(public_include "include") diff --git a/components/esp_hal_gpspi/CMakeLists.txt b/components/esp_hal_gpspi/CMakeLists.txt index 9dd01b7f890..c2a25aacd24 100644 --- a/components/esp_hal_gpspi/CMakeLists.txt +++ b/components/esp_hal_gpspi/CMakeLists.txt @@ -1,5 +1,9 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + return() # This component is not supported by the POSIX/Linux simulator +endif() + set(srcs) set(includes "include") diff --git a/tools/test_apps/linux_compatible/.build-test-rules.yml b/tools/test_apps/linux_compatible/.build-test-rules.yml index 2daceb4b610..b0cf440652b 100644 --- a/tools/test_apps/linux_compatible/.build-test-rules.yml +++ b/tools/test_apps/linux_compatible/.build-test-rules.yml @@ -11,6 +11,10 @@ tools/test_apps/linux_compatible/linux_freertos: enable: - if: IDF_TARGET == "linux" +tools/test_apps/linux_compatible/linux_full_build: + enable: + - if: IDF_TARGET == "linux" + tools/test_apps/linux_compatible/mock_build_test: enable: - if: IDF_TARGET == "linux" diff --git a/tools/test_apps/linux_compatible/linux_full_build/CMakeLists.txt b/tools/test_apps/linux_compatible/linux_full_build/CMakeLists.txt new file mode 100644 index 00000000000..b244e1aaa7c --- /dev/null +++ b/tools/test_apps/linux_compatible/linux_full_build/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.22) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) + +# Keep COMPONENTS unset and disable minimal build so every Linux-compatible +# component is compiled and linked for this app. +idf_build_set_property(MINIMAL_BUILD OFF) + +project(linux_full_build) diff --git a/tools/test_apps/linux_compatible/linux_full_build/README.md b/tools/test_apps/linux_compatible/linux_full_build/README.md new file mode 100644 index 00000000000..6784e358690 --- /dev/null +++ b/tools/test_apps/linux_compatible/linux_full_build/README.md @@ -0,0 +1,4 @@ +| Supported Targets | Linux | +| ----------------- | ----- | + +This application verifies that all Linux-compatible components compile, link, and run when the project does not limit the component set. diff --git a/tools/test_apps/linux_compatible/linux_full_build/main/CMakeLists.txt b/tools/test_apps/linux_compatible/linux_full_build/main/CMakeLists.txt new file mode 100644 index 00000000000..efa2265fc76 --- /dev/null +++ b/tools/test_apps/linux_compatible/linux_full_build/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "linux_full_build.c" + INCLUDE_DIRS ".") diff --git a/tools/test_apps/linux_compatible/linux_full_build/main/linux_full_build.c b/tools/test_apps/linux_compatible/linux_full_build/main/linux_full_build.c new file mode 100644 index 00000000000..1d73946a990 --- /dev/null +++ b/tools/test_apps/linux_compatible/linux_full_build/main/linux_full_build.c @@ -0,0 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ + +#include + +void app_main(void) +{ + printf("Linux full component build test done\n"); +} diff --git a/tools/test_apps/linux_compatible/linux_full_build/pytest_linux_full_build.py b/tools/test_apps/linux_compatible/linux_full_build/pytest_linux_full_build.py new file mode 100644 index 00000000000..d2f7116f488 --- /dev/null +++ b/tools/test_apps/linux_compatible/linux_full_build/pytest_linux_full_build.py @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Unlicense OR CC0-1.0 +import pytest +from pytest_embedded_idf.dut import IdfDut +from pytest_embedded_idf.utils import idf_parametrize + + +@pytest.mark.host_test +@idf_parametrize('target', ['linux'], indirect=['target']) +def test_linux_full_build(dut: IdfDut) -> None: + dut.expect_exact('Linux full component build test done')